summaryrefslogtreecommitdiffstats
path: root/c/src/make/leaf.cfg
blob: dd0defe57667e1b29c448257a264f075bd7be530 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# make/leaf.cfg
#
#   Make(1) configuration file include'd by all leaf-node Makefiles
#

# Allow user to override link commands (to build a prom image, perhaps)
ifndef LINKCMDS
LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
endif

## what to do about $(EXEEXT) --> $(EXEEXT)
##    -o $(basename $@)$(EXEEXT)             OR
##    -o $(basename $@)$(EXEEXT)                  OR

DOWNEXT=.ralf

define bsp-link-c
	$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
	    -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
endef

define bsp-link-cxx
	$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
	    -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
endef

define default-bsp-post-link
	$(NM) -g -n $@ > $(basename $@).num
	$(SIZE) $@
endef

ifndef bsp-post-link
  define bsp-post-link
	$(default-bsp-post-link)
	cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)
  endef
endif

define make-exe
       $(bsp-link-c)
       $(bsp-post-link)
endef

define make-cxx-exe
       $(bsp-link-cxx)
       $(bsp-post-link)
endef