source: umon/main/make/common.make @ d871a74

Last change on this file since d871a74 was d871a74, checked in by Jarielle Catbagan <jcatbagan93@…>, on 06/19/15 at 21:32:47

Fixed BASE variable in common.make

The BASE variable was changed from $(TOPDIR)/target -> $(TOPDIR) as the "target"
directory's contents were moved to the $(TOPDIR).

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[87db514]1############################################################################
2#
3# common.make:
4# This file contains all the common stuff used by MicroMonitor port-specific
5# make files.
6
7############################################################################
8#
9# Various relative directories used to build the monitor:
10#
[d871a74]11BASE            = $(TOPDIR)
[87db514]12CPUDIR          = $(BASE)/cpu/$(CPUTYPE)
13ZLIBDIR         = $(BASE)/zlib
14GLIBDIR         = $(BASE)/glib
15COMDIR          = $(BASE)/common
16MAKEDIR         = $(BASE)/make
17DEVDIR          = $(BASE)/dev
18FSDIR           = $(BASE)/fs
19FATFSDIR        = $(FSDIR)/elmfatfs
20JFFS2DIR        = $(BASE)/fs/jffs2
21
22ifeq ($(TOOLBIN),)
23TOOLBIN         = $(TOPDIR)/host/bin
24endif
25
26############################################################################
27#
28# Generic tools used by all make files:
29# Names are derived from the TOOL_PREFIX variable
30# assumed to be established in the make file that
31# includes this.
32#
33
34ifeq ($(TOOL_PREFIX),)
35TOOL_PREFIX             = $(CPUTYPE)-$(FILETYPE)
36endif
37NM                              = $(TOOL_PREFIX)-nm
38AR                              = $(TOOL_PREFIX)-ar
39LD                              = $(TOOL_PREFIX)-ld
40ASM                             = $(TOOL_PREFIX)-as
41CC                              = $(TOOL_PREFIX)-gcc
42STRIP                   = $(TOOL_PREFIX)-strip
43OBJCOPY                 = $(TOOL_PREFIX)-objcopy
44OBJDUMP                 = $(TOOL_PREFIX)-objdump
45
46LIBGCC                  = `$(CC) --print-libgcc-file-name`
47LIBDIR                  = $(LIBGCC:/libgcc.a=)
48NOF_LIBGCC              = $(LIBDIR)/nof/libgcc.a
49
50# FLASHSUBDIR:
51# This is actually a portion of the PATH to the flash source files.
52# If not specified in the port-specific makefile, then assign the
53# default type of "devices".  This then makes the assumption that
54# the files specified by the FLASHSRC variable in the port-specific
55# makefile are under $(BASE)/flash/devices (the new style flash
56# driver for uMon).  For the older drivers, use the appropriate
57# directory found under "boards" in the umon_main tree.
58# The prefix $(BASE)/flash is assumed.
59#
60ifeq ($(FLASHSUBDIR),)
61FLASHSUBDIR     = devices
62endif
63
64ifeq ($(FLASHDIR),)
65FLASHDIR        = $(BASE)/flash/$(FLASHSUBDIR)
66endif
67
68# PORTDIR:
69# By default, PORTDIR is umon/umon_ports; however some ports are not part
70# of the CVS distribution; hence, umon/umon_ports sometimes needs to be
71# overridden...
72ifeq ($(PORTDIR),)
73PORTDIR = umon/umon_ports
74endif
75
76############################################################################
77#
78# Miscellaneous variables used by all targets:
79#
80DEPEND                  = depend
81DEPENDFILE              = depends
82BUILDDIR                = build_$(PLATFORM)
83
84COMMON_INCLUDE  = -I. -I$(COMDIR) -I$(CPUDIR) -I$(FLASHDIR) -I$(DEVDIR) \
85                                  -I$(ZLIBDIR) $(PORT_INCLUDE)
86
87COMMON_CFLAGS   = -g -c -Wall -DPLATFORM_$(PLATFORM)=1 \
88                                  -fno-builtin -fno-toplevel-reorder
89
90COMMON_AFLAGS   = -xassembler-with-cpp -c -D PLATFORM_$(PLATFORM)=1 \
91                                  -D ASSEMBLY_ONLY
92
93CFLAGS                  = $(COMMON_CFLAGS) $(CUSTOM_CFLAGS) $(COMMON_INCLUDE) \
94                                  $(CUSTOM_INCLUDE)
95ASMFLAGS                = $(COMMON_AFLAGS) $(CUSTOM_AFLAGS) $(COMMON_INCLUDE) \
96                                  $(CUSTOM_INCLUDE)
97
98
99MAKE_LDFILE             = $(TOOLBIN)/vsub $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) \
100                                  $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
101MAKE_MONBUILT   = $(CC) $(COMMON_CFLAGS) $(CUSTOM_CFLAGS) \
102                                        $(COMMON_INCLUDE) -omonbuilt.o $(COMDIR)/monbuilt.c
103MAKE_GNUSYMS    = $(NM) --numeric-sort $@ > $(@:.$(FILETYPE)=.gsym)
104DUMP_MAP                = $(OBJDUMP) -fh $@
105MAKE_BINARY             = $(OBJCOPY) -O binary $@ $(@:.$(FILETYPE)=.bin)
106LINK                    = $(LD) -nostartfiles -o $@ \
107                                  -T $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
108DISASSEMBLE             = $(OBJDUMP) --source --disassemble $@> \
109                                  $(@:.$(FILETYPE)=.dis)
110
111MAKE_CTAGS              = ctags --file-tags=yes -n -L cscope.files
112MAKE_MONSYMS    = $(TOOLBIN)/monsym -p0x -Pmm_ -Sx $(@:.$(FILETYPE)=.gsym) > \
113                                  $(@:.$(FILETYPE)=.usym)
114DUMP_MAP_ALT    = $(TOOLBIN)/$(FILETYPE) -m $@
115MAKE_BINARY_ALT = $(TOOLBIN)/$(FILETYPE) -B $(@:.$(FILETYPE)=.bin) $@
116
117############################################################################
118#
119# Various source lists used to build libraries:
120#
121FATFSSRC        = ff.c ffcmd.c cc932.c
122
123ZLIBSRC         = adler32.c gzio.c infblock.c infcodes.c inffast.c inflate.c \
124                          inftrees.c infutil.c trees.c uncompr.c zcrc32.c zutil.c
125
126GLIBSRC         = abs.c asctime.c atoi.c crc16.c crc32.c div.c \
127                          getopt.c inrange.c ldiv.c memccpy.c memchr.c \
128                          memcmp.c memcpy.c memset.c pollconsole.c prascii.c printmem.c \
129                          smemcpy.c smemset.c strcat.c strchr.c strcasecmp.c \
130                          strcmp.c strcpy.c strlen.c strncat.c strncmp.c \
131                          strncpy.c strpbrk.c strrchr.c strstr.c strtok.c \
132                          strtol.c strtoul.c strtolower.c swap.c ticktock.c
Note: See TracBrowser for help on using the repository browser.