diff --git a/Makefile b/Makefile index 6116b00..baf1962 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ create_build_dir: SRCS = rtlplayground.c rtl837x_flash.c rtl837x_phy.c rtl837x_port.c cmd_parser.c html_data.c rtl837x_igmp.c rtl837x_stp.c OBJS = ${SRCS:%.c=$(BUILDDIR)%.rel} -OBJS += uip/timer.rel uip/uip-fw.rel uip/uip-neighbor.rel uip/uip-split.rel uip/uip.rel uip/uip_arp.rel uip/uiplib.rel httpd/httpd.rel httpd/page_impl.rel +OBJS += uip/timer.rel uip/uip-fw.rel uip/uip-neighbor.rel uip/uip-split.rel uip/uip.rel uip/uip_arp.rel uip/uiplib.rel httpd/$(BUILDDIR)/httpd.rel httpd/$(BUILDDIR)/page_impl.rel html_data.c html_data.h: html tools tools/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -b BANK1 -d html -p html_data diff --git a/httpd/Makefile b/httpd/Makefile index 397f46c..d801ddf 100644 --- a/httpd/Makefile +++ b/httpd/Makefile @@ -3,21 +3,26 @@ CC_FLAGS = -mmcs51 -I. -I../uip ASM = sdas8051 AFLAGS= -plosgff +BUILDDIR = output/ + SRCS = httpd.c page_impl.c -OBJS = ${SRCS:.c=.rel} +OBJS = ${SRCS:%.c=$(BUILDDIR)%.rel} -all: $(OBJS) +all: create_build_dir $(OBJS) -%.asm: %.c - $(CC) $(CC_FLAGS) -c -S $< +create_build_dir: + mkdir -p $(BUILDDIR) -%.rel: %.asm +$(BUILDDIR)%.asm: %.c + $(CC) $(CC_FLAGS) -o $@ -c -S $< + +$(BUILDDIR)%.rel: $(BUILDDIR)%.asm ./treatasm.py $^ >$^.new mv $^.new $^ - ${ASM} ${AFLAGS} $^ + ${ASM} ${AFLAGS} -o $@ $^ clean: - rm .asm *.lst *.rel *.rst *.sym + rm -r $(BUILDDIR) .PHONY: all clean