[c1c1f33] | 1 | # |
---|
| 2 | # $Id$ |
---|
| 3 | # |
---|
| 4 | # make/leaf.cfg |
---|
| 5 | # |
---|
| 6 | # Make(1) configuration file include'd by all leaf-node Makefiles |
---|
| 7 | # |
---|
| 8 | |
---|
| 9 | # |
---|
| 10 | # list of all known managers |
---|
| 11 | # This list is used, along with $(MANAGERS) (set by app makefile) |
---|
| 12 | # to build the list of *not wanted* drivers. |
---|
| 13 | # |
---|
| 14 | # ref: target compiler config file for usage |
---|
| 15 | # |
---|
| 16 | |
---|
[d54c028] | 17 | MANAGER_LIST=barrier dpmem event io msg mp part |
---|
| 18 | MANAGER_LIST+=region sem signal timer rtmon ext |
---|
[c1c1f33] | 19 | |
---|
| 20 | # Convert *real* spellings in $(MANAGERS) (set |
---|
| 21 | # in application makefile) to their "correct" name. |
---|
| 22 | # (I hate abbreviations :-) |
---|
| 23 | |
---|
| 24 | MANAGERS := $(patsubst message, msg, $(MANAGERS)) |
---|
| 25 | MANAGERS := $(patsubst multi_processor, mp, $(MANAGERS)) |
---|
| 26 | MANAGERS := $(patsubst partition, part, $(MANAGERS)) |
---|
| 27 | MANAGERS := $(patsubst rate_monotonic, rtmon, $(MANAGERS)) |
---|
| 28 | MANAGERS := $(patsubst semaphore, sem, $(MANAGERS)) |
---|
| 29 | MANAGERS := $(patsubst dual_ported_memory, dpmem, $(MANAGERS)) |
---|
| 30 | MANAGERS := $(patsubst extension, ext, $(MANAGERS)) |
---|
| 31 | |
---|
| 32 | # allow 'all' to mean all managers |
---|
| 33 | MANAGERS := $(patsubst all, $(MANAGER_LIST), $(MANAGERS)) |
---|
| 34 | |
---|
| 35 | # and finally rip out duplicates |
---|
| 36 | MANAGERS := $(sort $(MANAGERS)) |
---|
| 37 | |
---|
[7e5a481] | 38 | # List (possibly empty) of required managers |
---|
[d54c028] | 39 | MANAGERS_REQUIRED= |
---|
[7e5a481] | 40 | |
---|
| 41 | # Create a RTEMS executable based on MANAGERS which was set in |
---|
| 42 | # app's Makefile |
---|
| 43 | |
---|
| 44 | MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS) \ |
---|
| 45 | $(MANAGERS_REQUIRED), $(MANAGER_LIST)) |
---|
| 46 | |
---|
| 47 | # Allow user to override link commands (to build a prom image, perhaps) |
---|
| 48 | ifndef LINKCMDS |
---|
| 49 | LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds |
---|
[c1c1f33] | 50 | endif |
---|
[3617ebe] | 51 | |
---|
| 52 | ## what to do about $(EXEEXT) --> $(EXEEXT) |
---|
| 53 | ## -o $(basename $@)$(EXEEXT) OR |
---|
| 54 | ## -o $(basename $@)$(EXEEXT) OR |
---|
| 55 | |
---|
| 56 | DOWNEXT=.ralf |
---|
| 57 | |
---|
| 58 | define bsp-link-c |
---|
[20e1bdfc] | 59 | $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ |
---|
[3617ebe] | 60 | -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS) |
---|
| 61 | endef |
---|
| 62 | |
---|
| 63 | define bsp-link-cxx |
---|
[20e1bdfc] | 64 | $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ |
---|
[3617ebe] | 65 | -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS) |
---|
| 66 | endef |
---|
| 67 | |
---|
| 68 | define default-bsp-post-link |
---|
| 69 | $(NM) -g -n $@ > $(basename $@).num |
---|
| 70 | $(SIZE) $@ |
---|
| 71 | endef |
---|
| 72 | |
---|
[cb697107] | 73 | ifndef bsp-post-link |
---|
| 74 | define bsp-post-link |
---|
[3617ebe] | 75 | $(default-bsp-post-link) |
---|
| 76 | cp $(basename $@).exe $(basename $@)$(DOWNEXT) |
---|
[cb697107] | 77 | endef |
---|
| 78 | endif |
---|
[3617ebe] | 79 | |
---|
| 80 | define make-exe |
---|
| 81 | $(bsp-link-c) |
---|
| 82 | $(bsp-post-link) |
---|
| 83 | endef |
---|
| 84 | |
---|
| 85 | define make-cxx-exe |
---|
| 86 | $(bsp-link-cxx) |
---|
| 87 | $(bsp-post-link) |
---|
| 88 | endef |
---|