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 FilesystemImage |
---|
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) |
---|
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 | LD_LIBS += |
---|
67 | |
---|
68 | # |
---|
69 | # Add your list of files to delete here. The config files |
---|
70 | # already know how to delete some stuff, so you may want |
---|
71 | # to just run 'make clean' first to see what gets missed. |
---|
72 | # 'make clobber' already includes 'make clean' |
---|
73 | # |
---|
74 | |
---|
75 | CLEAN_ADDITIONS += FilesystemImage FilesystemImage.c FilesystemImage.h |
---|
76 | CLEAN_ADDIRIONS += stamp-index-html rootfs/index.html |
---|
77 | CLOBBER_ADDITIONS += |
---|
78 | |
---|
79 | # strip out flags gcc knows but LD doesn't like -- add as needed |
---|
80 | LD_CPU_CFLAGS=$(CPU_CFLAGS:-mstrict-align:) |
---|
81 | |
---|
82 | COPY_ARCH=$(shell echo $(OBJCOPY) | cut -d'-' -f1) |
---|
83 | |
---|
84 | all: ${ARCH} $(SRCS) $(PGM) |
---|
85 | |
---|
86 | ${PGM}: $(OBJS) $(LINK_FILES) |
---|
87 | $(make-exe) |
---|
88 | |
---|
89 | |
---|
90 | $(ARCH)/init.c: init.c FilesystemImage.c |
---|
91 | |
---|
92 | FilesystemImage: $(ARCH) stamp-index-html |
---|
93 | cd rootfs ; \ |
---|
94 | tar cf ../FilesystemImage --exclude CVS --exclude .cvsignore . |
---|
95 | |
---|
96 | FilesystemImage.c: $(ARCH) FilesystemImage |
---|
97 | $(PROJECT_ROOT)/bin/bin2c FilesystemImage FilesystemImage |
---|
98 | |
---|
99 | stamp-index-html: index.html.in |
---|
100 | ifneq ($(HTTPD),) |
---|
101 | sed -e 's/@SERVER@/$(HTTPD)/' <index.html.in >rootfs/index.html |
---|
102 | endif |
---|
103 | touch stamp-index-html |
---|
104 | |
---|
105 | # Install the program(s), appending _g or _p as appropriate. |
---|
106 | # for include files, just use $(INSTALL) |
---|
107 | install: all |
---|
108 | $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests |
---|
109 | |
---|