From dae367b568fe7a8f0a96b4626b52ce9a4d56298e Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Mon, 18 Jul 2011 18:53:17 +0200 Subject: [PATCH] Add dependency handling for lcd/ subdir --- firmware/Makefile | 3 +-- firmware/Makefile.util | 2 +- firmware/lcd/Makefile | 19 +++++++------------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 02a64c4..f92d179 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -27,8 +27,7 @@ INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core include $(ROOT_PATH)/Makefile.inc LDFLAGS+= -Wl,--gc-sections -VPATH += lpc1xxx -OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o +OBJS += lpc1xxx/$(TARGET)_handlers.o lpc1xxx/LPC1xxx_startup.o ########################################################################## # Startup files diff --git a/firmware/Makefile.util b/firmware/Makefile.util index d78795d..5e7916b 100644 --- a/firmware/Makefile.util +++ b/firmware/Makefile.util @@ -10,7 +10,7 @@ $(LIBFILE): $(OBJS) %.o : %.c $(CC) $(CFLAGS) -o $@ $< -clean: +clean:: rm -f $(OBJS) $(LIBFILE) $(CLEANFILES) depend: diff --git a/firmware/lcd/Makefile b/firmware/lcd/Makefile index 41795ed..fe639a3 100644 --- a/firmware/lcd/Makefile +++ b/firmware/lcd/Makefile @@ -24,27 +24,22 @@ include $(ROOT_PATH)/Makefile.inc FOBJS= $(foreach ft,$(FONTS),$(ft).o) OBJS+= $(FOBJS) -LIBFILE=lib$(LIBNAME).a + ########################################################################## -# Compiler settings, parameters and flags +# Actual work ########################################################################## -all: $(LIBFILE) allfonts.h +include $(ROOT_PATH)/Makefile.util -$(LIBFILE): $(OBJS) - $(AR) rcs $@ $(OBJS) - -%.o : %.c - $(CC) $(CFLAGS) -o $@ $< +all: allfonts.h $(FOBJS): $(foreach ft,$(FONTS),$(ft).h) fonts.h -clean: - rm -f $(OBJS) $(LIBFILE) fonts/*.o allfonts.h +clean:: + rm -f fonts/*.o allfonts.h touch allfonts.h -render.o: render.c render.h display.h fonts.h - .PHONY: allfonts.h + allfonts.h: (echo "#include ";for a in $(FONTS) ; do echo "#include "; done) > $@