Improve dependencies in lcd/ - add generated lcd/allfonts.h to avoid

including all the fonts one by one
This commit is contained in:
Stefan `Sec` Zehl 2011-05-21 19:12:51 +02:00
parent 48adee1693
commit 1d4790886a
4 changed files with 21 additions and 13 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ firmware.elf
*.swp
lpc1xxx/memory.ld
modules/wrapper.c
lcd/allfonts.h

View File

@ -3,16 +3,19 @@
##########################################################################
OBJS =
OBJS += smallfonts.o
OBJS += ubuntu18.o
OBJS += orbitron14.o
OBJS += display.o
OBJS += render.o
OBJS += decoder.o
OBJS += backlight.o
FONTS =
FONTS += smallfonts
FONTS += ubuntu18
FONTS += orbitron14
LIBNAME=lcd
##########################################################################
# GNU GCC compiler flags
##########################################################################
@ -21,21 +24,28 @@ INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
include $(ROOT_PATH)/Makefile.inc
FOBJS= $(foreach ft,$(FONTS),$(ft).o)
OBJS+= $(FOBJS)
LIBFILE=lib$(LIBNAME).a
##########################################################################
# Compiler settings, parameters and flags
##########################################################################
all: libfont.a
all: $(LIBFILE) allfonts.h
libfont.a: $(OBJS)
$(AR) rcs libfont.a $(OBJS)
$(LIBFILE): $(OBJS)
$(AR) rcs $@ $(OBJS)
%.o : %.c
$(CC) $(CFLAGS) -o $@ $<
$(FOBJS): $(foreach ft,$(FONTS),$(ft).h) fonts.h
clean:
rm -f $(OBJS) libfont.a
rm -f $(OBJS) $(LIBFILE) allfonts.h
render.o: render.c render.h display.h fonts.h
smallfonts.o: smallfonts.c smallfonts.h fonts.h
.PHONY: allfonts.h
allfonts.h:
for a in $(FONTS) ; do echo "#include <lcd/$$a.h>"; done > $@

2
main.c
View File

@ -3,8 +3,6 @@
#include "basic/basic.h"
#include "lcd/render.h"
#include "lcd/smallfonts.h"
#include "lcd/ubuntu18.h"
#include "pmu/pmu.h"
#include "eeprom/eeprom.h"

View File

@ -3,8 +3,7 @@
#include "basic/basic.h"
#include "lcd/render.h"
#include "lcd/smallfonts.h"
#include "lcd/ubuntu18.h"
#include "lcd/allfonts.h"
void ReinvokeISP(void);