diff options
Diffstat (limited to 'http/Makefile')
-rw-r--r-- | http/Makefile | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/http/Makefile b/http/Makefile index 0c092f1..3265b73 100644 --- a/http/Makefile +++ b/http/Makefile @@ -18,7 +18,7 @@ DOCTYPES= DOCS=$(DOCTYPES:%=$(SAMPLE).%) SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) +OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) $(ARCH)/tarfile.o PRINT_SRCS=$(DOCS) @@ -34,17 +34,35 @@ include $(PROJECT_ROOT)/make/leaf.cfg DEFINES += CPPFLAGS += -CFLAGS += -DWEBS -DUEMF CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0xC0000 CFLAGS_OPTIMIZE_V += CFLAGS_DEBUG_V += -v -qrtems_debug LD_PATHS += -LD_LIBS += -lhttpd -LD_LIBS += -lftpd + #NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1 | grep copy: | cut -d':' -f3 | cut -d' ' -f2) OBJDUMP=$(OBJCOPY:copy=dump) +USE_GOHEAD=no +USE_SIMPLE=yes +USE_FTPD=yes +ifeq ($(USE_GOHEAD),yes) + HTTPD = GoAhead Web Server + CFLAGS += -DWEBS -DUEMF -DUSE_GOAHEAD_HTTPD + LD_LIBS += -lhttpd +endif + +ifeq ($(USE_SIMPLE),yes) + HTTPD = Simple HTTPD Web Server + CFLAGS += -DUSE_SIMPLE_HTTPD + LD_LIBS += -lshttpd +endif + +ifeq ($(USE_FTPD),yes) + CFLAGS += -DUSE_FTPD + LD_LIBS += -lftpd +endif + # # Add your list of files to delete here. The config files # already know how to delete some stuff, so you may want @@ -52,7 +70,7 @@ OBJDUMP=$(OBJCOPY:copy=dump) # 'make clobber' already includes 'make clean' # -CLEAN_ADDITIONS += tarfile obj_format +CLEAN_ADDITIONS += tarfile obj_format stamp-index-html rootfs/index.html CLOBBER_ADDITIONS += # strip out flags gcc knows but LD doesn't like -- add as needed @@ -64,15 +82,20 @@ obj_format: $(OBJDUMP) -f $(ARCH)/init.o | grep .o: | \ sed -e 's/^.*format //' >obj_format -${PGM}: $(OBJS) obj_format $(LINK_FILES) +${PGM}: $(OBJS) $(LINK_FILES) + $(make-exe) + +$(ARCH)/tarfile.o: $(ARCH) stamp-index-html obj_format cd rootfs ; tar cf ../$(ARCH)/tarfile --exclude CVS . cp $(ARCH)/tarfile . $(OBJCOPY) -I binary -O `cat obj_format` tarfile $(ARCH)/tarfile.o - $(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o \ - $(ARCH)/init.o $(ARCH)/tarfile.o - $(MV) $(ARCH)/temp.o $(ARCH)/init.o - $(RM) $(ARCH)/temp.o - $(make-exe) + $(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o $(ARCH)/tarfile.o + +stamp-index-html: index.html.in +ifneq ($(HTTPD),) + sed -e 's/@SERVER@/$(HTTPD)/' <index.html.in >rootfs/index.html +endif + touch stamp-index-html # Install the program(s), appending _g or _p as appropriate. # for include files, just use $(INSTALL) |