altos/draw: use --gc-sections in demo program
[fw/altos] / src / draw / Makefile
1 TOPDIR=..
2 include $(TOPDIR)/Makefile.defs
3
4 vpath %.bdf fonts
5
6 BITMAP_SIZES = 10, 12, 14, 16, 18, 24, 26, 28, 32, 36, 48, 64, 72
7
8 BDFS=\
9         BenguiatGothicStd-Bold-10.bdf \
10         BenguiatGothicStd-Bold-12.bdf \
11         BenguiatGothicStd-Bold-14.bdf \
12         BenguiatGothicStd-Bold-16.bdf \
13         BenguiatGothicStd-Bold-18.bdf \
14         BenguiatGothicStd-Bold-24.bdf \
15         BenguiatGothicStd-Bold-26.bdf \
16         BenguiatGothicStd-Bold-28.bdf \
17         BenguiatGothicStd-Bold-32.bdf \
18         BenguiatGothicStd-Bold-36.bdf \
19         BenguiatGothicStd-Bold-48.bdf \
20         BenguiatGothicStd-Bold-64.bdf \
21         BenguiatGothicStd-Bold-72.bdf \
22         BenguiatGothicStd-Medium-10.bdf \
23         BenguiatGothicStd-Medium-12.bdf \
24         BenguiatGothicStd-Medium-14.bdf \
25         BenguiatGothicStd-Medium-16.bdf \
26         BenguiatGothicStd-Medium-18.bdf \
27         BenguiatGothicStd-Medium-24.bdf \
28         BenguiatGothicStd-Medium-26.bdf \
29         BenguiatGothicStd-Medium-28.bdf \
30         BenguiatGothicStd-Medium-32.bdf \
31         BenguiatGothicStd-Medium-36.bdf \
32         BenguiatGothicStd-Medium-48.bdf \
33         BenguiatGothicStd-Medium-64.bdf \
34         BenguiatGothicStd-Medium-72.bdf \
35         BitstreamVeraSansMono-Roman-10.bdf \
36         BitstreamVeraSansMono-Roman-12.bdf \
37         BitstreamVeraSansMono-Roman-14.bdf \
38         BitstreamVeraSansMono-Roman-16.bdf \
39         BitstreamVeraSansMono-Roman-18.bdf \
40         BitstreamVeraSansMono-Roman-24.bdf \
41         BitstreamVeraSansMono-Roman-26.bdf \
42         BitstreamVeraSansMono-Roman-28.bdf \
43         BitstreamVeraSansMono-Roman-32.bdf \
44         BitstreamVeraSansMono-Roman-36.bdf \
45         BitstreamVeraSansMono-Roman-48.bdf \
46         BitstreamVeraSansMono-Roman-64.bdf \
47         BitstreamVeraSansMono-Roman-72.bdf \
48         FrutigerLT-Roman-10.bdf \
49         FrutigerLT-Roman-12.bdf \
50         FrutigerLT-Roman-14.bdf \
51         FrutigerLT-Roman-16.bdf \
52         FrutigerLT-Roman-18.bdf \
53         FrutigerLT-Roman-24.bdf \
54         FrutigerLT-Roman-26.bdf \
55         FrutigerLT-Roman-28.bdf \
56         FrutigerLT-Roman-32.bdf \
57         FrutigerLT-Roman-36.bdf \
58         FrutigerLT-Roman-48.bdf \
59         FrutigerLT-Roman-64.bdf \
60         FrutigerLT-Roman-72.bdf \
61         NotoMono-10.bdf \
62         NotoMono-12.bdf \
63         NotoMono-14.bdf \
64         NotoMono-16.bdf \
65         NotoMono-18.bdf \
66         NotoMono-24.bdf \
67         NotoMono-26.bdf \
68         NotoMono-28.bdf \
69         NotoMono-32.bdf \
70         NotoMono-36.bdf \
71         NotoMono-48.bdf \
72         NotoMono-64.bdf \
73         NotoMono-72.bdf
74
75 FONT_SRCS=$(BDFS:.bdf=.c)
76
77 .SUFFIXES: .bdf .c
78
79 .bdf.c:
80         nickle font-convert -o $@ $<
81
82 all: ao_font.h ao_logo.h draw-test
83
84 $(FONT_SRCS): font-convert
85
86 ao_font.h: $(FONT_SRCS)
87         grep -h '^const struct ao_font' $(FONT_SRCS) | sed -e 's/^/extern /' -e 's/ =.*$$/;/' > $@
88
89 ao_logo.h: make-logo
90         nickle make-logo ao_logo > $@
91
92 SRCS=\
93         draw-test.c \
94         ao_blt.c \
95         ao_copy.c \
96         ao_line.c \
97         ao_pattern.c \
98         ao_rect.c \
99         ao_poly.c \
100         ao_text.c \
101         ao_logo.c \
102         $(FONT_SRCS)
103
104 OBJS=$(SRCS:.c=.o)
105
106 LIBS=-lXrender -lX11 -lm -Wl,--gc-sections
107
108 CFLAGS=-O2 -g $(WARN_FLAGS)
109
110 HEADERS=\
111         ao_draw.h \
112         ao_draw_int.h \
113         ao_font.h \
114         ao_logo.h
115
116 draw-test: $(OBJS)
117         cc $(CFLAGS) -o $@ $(OBJS) $(LIBS)
118
119 $(OBJS): $(HEADERS)
120
121 clean:
122         rm -f $(OBJS) ao_font.h ao_logo.h $(FONT_SRCS)