altos: Build in 'draw' directory first
[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, 58, 60, 62, 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         BitstreamVeraSans-Roman-10.bdf \
49         BitstreamVeraSans-Roman-12.bdf \
50         BitstreamVeraSans-Roman-14.bdf \
51         BitstreamVeraSans-Roman-16.bdf \
52         BitstreamVeraSans-Roman-18.bdf \
53         BitstreamVeraSans-Roman-24.bdf \
54         BitstreamVeraSans-Roman-26.bdf \
55         BitstreamVeraSans-Roman-28.bdf \
56         BitstreamVeraSans-Roman-32.bdf \
57         BitstreamVeraSans-Roman-36.bdf \
58         BitstreamVeraSans-Roman-48.bdf \
59         BitstreamVeraSans-Roman-58.bdf \
60         BitstreamVeraSans-Roman-60.bdf \
61         BitstreamVeraSans-Roman-62.bdf \
62         BitstreamVeraSans-Roman-64.bdf \
63         BitstreamVeraSans-Roman-72.bdf \
64         FrutigerLT-Roman-10.bdf \
65         FrutigerLT-Roman-12.bdf \
66         FrutigerLT-Roman-14.bdf \
67         FrutigerLT-Roman-16.bdf \
68         FrutigerLT-Roman-18.bdf \
69         FrutigerLT-Roman-24.bdf \
70         FrutigerLT-Roman-26.bdf \
71         FrutigerLT-Roman-28.bdf \
72         FrutigerLT-Roman-32.bdf \
73         FrutigerLT-Roman-36.bdf \
74         FrutigerLT-Roman-48.bdf \
75         FrutigerLT-Roman-64.bdf \
76         FrutigerLT-Roman-72.bdf \
77         NotoMono-10.bdf \
78         NotoMono-12.bdf \
79         NotoMono-14.bdf \
80         NotoMono-16.bdf \
81         NotoMono-18.bdf \
82         NotoMono-24.bdf \
83         NotoMono-26.bdf \
84         NotoMono-28.bdf \
85         NotoMono-32.bdf \
86         NotoMono-36.bdf \
87         NotoMono-48.bdf \
88         NotoMono-64.bdf \
89         NotoMono-72.bdf
90
91 FONT_SRCS=$(BDFS:.bdf=.c)
92
93 .SUFFIXES: .bdf .c
94
95 .bdf.c:
96         nickle font-convert -o $@ $<
97
98 all: ao_font.h ao_logo.h
99
100 test: lco-test line-test
101
102 $(FONT_SRCS): font-convert
103
104 ao_font.h: $(FONT_SRCS)
105         grep -h '^const struct ao_font' $(FONT_SRCS) | sed -e 's/^/extern /' -e 's/ =.*$$/;/' > $@
106
107 ao_logo.h: make-logo
108         nickle make-logo ao_logo > $@
109
110 LIB_SRCS=\
111         ao_blt.c \
112         ao_box.c \
113         ao_copy.c \
114         ao_line.c \
115         ao_pattern.c \
116         ao_rect.c \
117         ao_poly.c \
118         ao_text.c \
119         ao_logo.c \
120         $(FONT_SRCS)
121
122 LCO_TEST_SRCS=$(LIB_SRCS) lco-test.c
123 LCO_TEST_OBJS=$(LCO_TEST_SRCS:.c=.o)
124
125 LINE_TEST_SRCS=$(LIB_SRCS) line-test.c
126 LINE_TEST_OBJS=$(LINE_TEST_SRCS:.c=.o)
127
128 TEST_LIBS=-lXrender -lXext -lX11 -lm -Wl,--gc-sections
129
130 CFLAGS=-O3 -g $(WARN_FLAGS) -DVALIDATE -I.
131
132 HEADERS=\
133         ao_draw.h \
134         ao_draw_int.h \
135         ao_font.h \
136         ao_logo.h
137
138 lco-test: $(LCO_TEST_OBJS)
139         cc $(CFLAGS) -o $@ $(LCO_TEST_OBJS) $(TEST_LIBS)
140
141 lco-test.o: test-frame.c frame.c
142
143 $(LCO_TEST_OBJS): $(HEADERS)
144
145 line-test: $(LINE_TEST_OBJS)
146         cc $(CFLAGS) -o $@ $(LINE_TEST_OBJS) $(TEST_LIBS)
147
148 line-test.o: test-frame.c frame.c
149
150 $(LINE_TEST_OBJS): $(HEADERS)
151
152 clean:
153         rm -f $(LCO_TEST_OBJS) ao_font.h ao_logo.h $(FONT_SRCS)