altos/draw: use --gc-sections in demo program
[fw/altos] / src / draw / Makefile
index 46771f1fde7c8b5576c2192631b44f1b8e550770..cbbd3457db14d7beafe7e714c33a5914221f8ead 100644 (file)
@@ -1,19 +1,83 @@
+TOPDIR=..
+include $(TOPDIR)/Makefile.defs
+
+vpath %.bdf fonts
+
+BITMAP_SIZES = 10, 12, 14, 16, 18, 24, 26, 28, 32, 36, 48, 64, 72
+
 BDFS=\
+       BenguiatGothicStd-Bold-10.bdf \
+       BenguiatGothicStd-Bold-12.bdf \
+       BenguiatGothicStd-Bold-14.bdf \
+       BenguiatGothicStd-Bold-16.bdf \
+       BenguiatGothicStd-Bold-18.bdf \
+       BenguiatGothicStd-Bold-24.bdf \
+       BenguiatGothicStd-Bold-26.bdf \
+       BenguiatGothicStd-Bold-28.bdf \
+       BenguiatGothicStd-Bold-32.bdf \
+       BenguiatGothicStd-Bold-36.bdf \
+       BenguiatGothicStd-Bold-48.bdf \
+       BenguiatGothicStd-Bold-64.bdf \
+       BenguiatGothicStd-Bold-72.bdf \
+       BenguiatGothicStd-Medium-10.bdf \
+       BenguiatGothicStd-Medium-12.bdf \
+       BenguiatGothicStd-Medium-14.bdf \
+       BenguiatGothicStd-Medium-16.bdf \
+       BenguiatGothicStd-Medium-18.bdf \
+       BenguiatGothicStd-Medium-24.bdf \
+       BenguiatGothicStd-Medium-26.bdf \
+       BenguiatGothicStd-Medium-28.bdf \
+       BenguiatGothicStd-Medium-32.bdf \
+       BenguiatGothicStd-Medium-36.bdf \
+       BenguiatGothicStd-Medium-48.bdf \
+       BenguiatGothicStd-Medium-64.bdf \
+       BenguiatGothicStd-Medium-72.bdf \
+       BitstreamVeraSansMono-Roman-10.bdf \
+       BitstreamVeraSansMono-Roman-12.bdf \
+       BitstreamVeraSansMono-Roman-14.bdf \
+       BitstreamVeraSansMono-Roman-16.bdf \
+       BitstreamVeraSansMono-Roman-18.bdf \
+       BitstreamVeraSansMono-Roman-24.bdf \
+       BitstreamVeraSansMono-Roman-26.bdf \
+       BitstreamVeraSansMono-Roman-28.bdf \
+       BitstreamVeraSansMono-Roman-32.bdf \
+       BitstreamVeraSansMono-Roman-36.bdf \
+       BitstreamVeraSansMono-Roman-48.bdf \
+       BitstreamVeraSansMono-Roman-64.bdf \
+       BitstreamVeraSansMono-Roman-72.bdf \
        FrutigerLT-Roman-10.bdf \
        FrutigerLT-Roman-12.bdf \
        FrutigerLT-Roman-14.bdf \
+       FrutigerLT-Roman-16.bdf \
        FrutigerLT-Roman-18.bdf \
        FrutigerLT-Roman-24.bdf \
+       FrutigerLT-Roman-26.bdf \
+       FrutigerLT-Roman-28.bdf \
+       FrutigerLT-Roman-32.bdf \
        FrutigerLT-Roman-36.bdf \
        FrutigerLT-Roman-48.bdf \
        FrutigerLT-Roman-64.bdf \
+       FrutigerLT-Roman-72.bdf \
+       NotoMono-10.bdf \
+       NotoMono-12.bdf \
+       NotoMono-14.bdf \
+       NotoMono-16.bdf \
+       NotoMono-18.bdf \
+       NotoMono-24.bdf \
+       NotoMono-26.bdf \
+       NotoMono-28.bdf \
+       NotoMono-32.bdf \
+       NotoMono-36.bdf \
+       NotoMono-48.bdf \
+       NotoMono-64.bdf \
+       NotoMono-72.bdf
 
 FONT_SRCS=$(BDFS:.bdf=.c)
 
 .SUFFIXES: .bdf .c
 
 .bdf.c:
-       nickle font-convert $*.bdf > $@
+       nickle font-convert -o $@ $<
 
 all: ao_font.h ao_logo.h draw-test
 
@@ -22,8 +86,8 @@ $(FONT_SRCS): font-convert
 ao_font.h: $(FONT_SRCS)
        grep -h '^const struct ao_font' $(FONT_SRCS) | sed -e 's/^/extern /' -e 's/ =.*$$/;/' > $@
 
-ao_logo.h: make-logo Makefile
-       nickle make-logo ao_logo 48 0 10 > $@
+ao_logo.h: make-logo
+       nickle make-logo ao_logo > $@
 
 SRCS=\
        draw-test.c \
@@ -39,9 +103,9 @@ SRCS=\
 
 OBJS=$(SRCS:.c=.o)
 
-LIBS=-lXrender -lX11 -lm
+LIBS=-lXrender -lX11 -lm -Wl,--gc-sections
 
-CFLAGS=-O0 -g
+CFLAGS=-O2 -g $(WARN_FLAGS)
 
 HEADERS=\
        ao_draw.h \