Add dependency handling for lcd/ subdir

This commit is contained in:
Stefan `Sec` Zehl 2011-07-18 18:53:17 +02:00
parent ff5bbad940
commit dae367b568
3 changed files with 9 additions and 15 deletions

View File

@ -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

View File

@ -10,7 +10,7 @@ $(LIBFILE): $(OBJS)
%.o : %.c
$(CC) $(CFLAGS) -o $@ $<
clean:
clean::
rm -f $(OBJS) $(LIBFILE) $(CLEANFILES)
depend:

View File

@ -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 <lcd/fonts.h>";for a in $(FONTS) ; do echo "#include <lcd/$$a.h>"; done) > $@