1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | SAMPLE=http |
---|
6 | PGM=${ARCH}/$(SAMPLE).exe |
---|
7 | |
---|
8 | MANAGERS=all |
---|
9 | |
---|
10 | # C source names, if any, go here -- minus the .c |
---|
11 | C_PIECES=init |
---|
12 | C_FILES=$(C_PIECES:%=%.c) |
---|
13 | C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) |
---|
14 | |
---|
15 | H_FILES= |
---|
16 | |
---|
17 | DOCTYPES= |
---|
18 | DOCS=$(DOCTYPES:%=$(SAMPLE).%) |
---|
19 | |
---|
20 | SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) |
---|
21 | OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) $(ARCH)/tarfile.o |
---|
22 | |
---|
23 | PRINT_SRCS=$(DOCS) |
---|
24 | |
---|
25 | PGM=${ARCH}/$(SAMPLE).exe |
---|
26 | |
---|
27 | include $(RTEMS_MAKEFILE_PATH)/Makefile.inc |
---|
28 | include $(RTEMS_CUSTOM) |
---|
29 | include $(PROJECT_ROOT)/make/leaf.cfg |
---|
30 | |
---|
31 | # |
---|
32 | # (OPTIONAL) Add local stuff here using += |
---|
33 | # |
---|
34 | |
---|
35 | DEFINES += |
---|
36 | CPPFLAGS += |
---|
37 | CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0xC0000 |
---|
38 | CFLAGS_OPTIMIZE_V += |
---|
39 | CFLAGS_DEBUG_V += -v -qrtems_debug |
---|
40 | |
---|
41 | LD_PATHS += |
---|
42 | |
---|
43 | #NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1 | grep copy: | cut -d':' -f3 | cut -d' ' -f2) |
---|
44 | OBJDUMP=$(OBJCOPY:copy=dump) |
---|
45 | |
---|
46 | USE_GOHEAD=no |
---|
47 | USE_SIMPLE=yes |
---|
48 | USE_FTPD=yes |
---|
49 | ifeq ($(USE_GOHEAD),yes) |
---|
50 | HTTPD = GoAhead Web Server |
---|
51 | CFLAGS += -DWEBS -DUEMF -DUSE_GOAHEAD_HTTPD |
---|
52 | LD_LIBS += -lhttpd |
---|
53 | endif |
---|
54 | |
---|
55 | ifeq ($(USE_SIMPLE),yes) |
---|
56 | HTTPD = Simple HTTPD Web Server |
---|
57 | CFLAGS += -DUSE_SIMPLE_HTTPD |
---|
58 | LD_LIBS += -lshttpd |
---|
59 | endif |
---|
60 | |
---|
61 | ifeq ($(USE_FTPD),yes) |
---|
62 | CFLAGS += -DUSE_FTPD |
---|
63 | LD_LIBS += -lftpd |
---|
64 | endif |
---|
65 | |
---|
66 | # |
---|
67 | # Add your list of files to delete here. The config files |
---|
68 | # already know how to delete some stuff, so you may want |
---|
69 | # to just run 'make clean' first to see what gets missed. |
---|
70 | # 'make clobber' already includes 'make clean' |
---|
71 | # |
---|
72 | |
---|
73 | CLEAN_ADDITIONS += tarfile obj_format stamp-index-html rootfs/index.html |
---|
74 | CLOBBER_ADDITIONS += |
---|
75 | |
---|
76 | # strip out flags gcc knows but LD doesn't like -- add as needed |
---|
77 | LD_CPU_CFLAGS=$(CPU_CFLAGS:-mstrict-align:) |
---|
78 | |
---|
79 | all: ${ARCH} $(SRCS) $(PGM) |
---|
80 | |
---|
81 | obj_format: |
---|
82 | $(OBJDUMP) -f $(ARCH)/init.o | grep .o: | \ |
---|
83 | sed -e 's/^.*format //' >obj_format |
---|
84 | |
---|
85 | ${PGM}: $(OBJS) $(LINK_FILES) |
---|
86 | $(make-exe) |
---|
87 | |
---|
88 | $(ARCH)/tarfile.o: $(ARCH) stamp-index-html obj_format |
---|
89 | cd rootfs ; tar cf ../$(ARCH)/tarfile --exclude CVS . |
---|
90 | cp $(ARCH)/tarfile . |
---|
91 | $(OBJCOPY) -I binary -O `cat obj_format` tarfile $(ARCH)/tarfile.o |
---|
92 | $(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o $(ARCH)/tarfile.o |
---|
93 | |
---|
94 | stamp-index-html: index.html.in |
---|
95 | ifneq ($(HTTPD),) |
---|
96 | sed -e 's/@SERVER@/$(HTTPD)/' <index.html.in >rootfs/index.html |
---|
97 | endif |
---|
98 | touch stamp-index-html |
---|
99 | |
---|
100 | # Install the program(s), appending _g or _p as appropriate. |
---|
101 | # for include files, just use $(INSTALL) |
---|
102 | install: all |
---|
103 | $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests |
---|