summarylogtreecommitdiffstats
path: root/Makefile.am
blob: a1cb37d67a861a3b9a7669361475124727cbe3af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319

AM_LDFLAGS=
AM_CFLAGS=

DEFS+= \
    -Icsrc -Icppsrc -Idogmsrc -Inonarduino \
    `getconf LFS_CFLAGS` \
    `getconf LFS64_CFLAGS` \
    -D_GNU_SOURCE \
    -D_FILE_OFFSET_BITS=64 \
    $(NULL)

AM_CFLAGS+= \
    -I$(top_builddir)/include/ \
    $(NULL)

AM_LDFLAGS += \
    -L$(top_builddir)/src/ \
    `getconf LFS_LDFLAGS` \
    `getconf LFS64_LDFLAGS` \
    $(NULL)

if DEBUG
# use "valgrind --tool=memcheck --leak-check=yes" to check memory leak, MemWatch will drag the program.
#DEFS+=-DMEMWATCH
DEFS+= -DDEBUG=1
AM_CFLAGS+=-g -Wall

else
AM_CFLAGS+=-O3 -Wall
endif

EXT_FLAGS=
@MK@GITNUMTMP=$(shell cd "$(top_srcdir)"; A=$$(git show | head -n 1 | awk '{print $$2}'); echo $${A:0:7}; cd - > /dev/null )
#@MK@SVNNUMTMP=$(shell cd "$(top_srcdir)"; LC_ALL=C svn info | grep -i Revision | awk '{print $$2}'; cd - > /dev/null )
#@MK@ifeq ($(SVNNUMTMP),)
#EXT_FLAGS+= -DSVN_VERSION='"${GITNUMTMP}"'
#@MK@else
#EXT_FLAGS+= -DSVN_VERSION='"${SVNNUMTMP}"'
#@MK@endif
@MK@ifeq ($(GITNUMTMP),)
@MK@else
EXT_FLAGS+= -DSVN_VERSION='"${GITNUMTMP}"'
@MK@endif
DEFS+=$(EXT_FLAGS)

SRC_BASE= \
    csrc/chessengine.c \
    csrc/u8g_bitmap.c \
    csrc/u8g_circle.c \
    csrc/u8g_clip.c \
    csrc/u8g_com_api_16gr.c \
    csrc/u8g_com_api.c \
    csrc/u8g_com_arduino_attiny85_hw_spi.c \
    csrc/u8g_com_arduino_common.c \
    csrc/u8g_com_arduino_fast_parallel.c \
    csrc/u8g_com_arduino_hw_spi.c \
    csrc/u8g_com_arduino_hw_usart_spi.c \
    csrc/u8g_com_arduino_no_en_parallel.c \
    csrc/u8g_com_arduino_parallel.c \
    csrc/u8g_com_arduino_port_d_wr.c \
    csrc/u8g_com_arduino_ssd_i2c.c \
    csrc/u8g_com_arduino_st7920_custom.c \
    csrc/u8g_com_arduino_st7920_hw_spi.c \
    csrc/u8g_com_arduino_st7920_spi.c \
    csrc/u8g_com_arduino_std_sw_spi.c \
    csrc/u8g_com_arduino_sw_spi.c \
    csrc/u8g_com_arduino_t6963.c \
    csrc/u8g_com_arduino_uc_i2c.c \
    csrc/u8g_com_atmega_hw_spi.c \
    csrc/u8g_com_atmega_parallel.c \
    csrc/u8g_com_atmega_st7920_hw_spi.c \
    csrc/u8g_com_atmega_st7920_spi.c \
    csrc/u8g_com_atmega_sw_spi.c \
    csrc/u8g_com_msp430_hw_spi.c \
    csrc/u8g_com_null.c \
    csrc/u8g_com_std_sw_spi.c \
    csrc/u8g_cursor.c \
    csrc/u8g_delay.c \
    csrc/u8g_dev_a2_micro_printer.c \
    csrc/u8g_dev_flipdisc_2x7.c \
    csrc/u8g_dev_gprof.c \
    csrc/u8g_dev_ht1632.c \
    csrc/u8g_dev_ili9325d_320x240.c \
    csrc/u8g_dev_ks0108_128x64.c \
    csrc/u8g_dev_lc7981_160x80.c \
    csrc/u8g_dev_lc7981_240x128.c \
    csrc/u8g_dev_lc7981_240x64.c \
    csrc/u8g_dev_lc7981_320x64.c \
    csrc/u8g_dev_ld7032_60x32.c \
    csrc/u8g_dev_null.c \
    csrc/u8g_dev_pcd8544_84x48.c \
    csrc/u8g_dev_pcf8812_96x65.c \
    csrc/u8g_dev_sbn1661_122x32.c \
    csrc/u8g_dev_ssd1306_128x32.c \
    csrc/u8g_dev_ssd1306_128x64.c \
    csrc/u8g_dev_ssd1309_128x64.c \
    csrc/u8g_dev_ssd1322_nhd31oled_bw.c \
    csrc/u8g_dev_ssd1322_nhd31oled_gr.c \
    csrc/u8g_dev_ssd1325_nhd27oled_bw.c \
    csrc/u8g_dev_ssd1325_nhd27oled_bw_new.c \
    csrc/u8g_dev_ssd1325_nhd27oled_gr.c \
    csrc/u8g_dev_ssd1325_nhd27oled_gr_new.c \
    csrc/u8g_dev_ssd1327_96x96_gr.c \
    csrc/u8g_dev_ssd1351_128x128.c \
    csrc/u8g_dev_ssd1353_160x128.c \
    csrc/u8g_dev_st7565_64128n.c \
    csrc/u8g_dev_st7565_dogm128.c \
    csrc/u8g_dev_st7565_dogm132.c \
    csrc/u8g_dev_st7565_lm6059.c \
    csrc/u8g_dev_st7565_lm6063.c \
    csrc/u8g_dev_st7565_nhd_c12832.c \
    csrc/u8g_dev_st7565_nhd_c12864.c \
    csrc/u8g_dev_st7687_c144mvgd.c \
    csrc/u8g_dev_st7920_128x64.c \
    csrc/u8g_dev_st7920_192x32.c \
    csrc/u8g_dev_st7920_202x32.c \
    csrc/u8g_dev_t6963_128x128.c \
    csrc/u8g_dev_t6963_128x64.c \
    csrc/u8g_dev_t6963_240x128.c \
    csrc/u8g_dev_t6963_240x64.c \
    csrc/u8g_dev_tls8204_84x48.c \
    csrc/u8g_dev_uc1601_c128032.c \
    csrc/u8g_dev_uc1608_240x128.c \
    csrc/u8g_dev_uc1608_240x64.c \
    csrc/u8g_dev_uc1610_dogxl160.c \
    csrc/u8g_dev_uc1611_dogm240.c \
    csrc/u8g_dev_uc1611_dogxl240.c \
    csrc/u8g_dev_uc1701_dogs102.c \
    csrc/u8g_dev_uc1701_mini12864.c \
    csrc/u8g_ellipse.c \
    csrc/u8g_font.c \
    csrc/u8g_line.c \
    csrc/u8g_page.c \
    csrc/u8g_pb14v1.c \
    csrc/u8g_pb16h1.c \
    csrc/u8g_pb16h2.c \
    csrc/u8g_pb16v1.c \
    csrc/u8g_pb16v2.c \
    csrc/u8g_pb32h1.c \
    csrc/u8g_pb8h1.c \
    csrc/u8g_pb8h1f.c \
    csrc/u8g_pb8h2.c \
    csrc/u8g_pb8h8.c \
    csrc/u8g_pb8v1.c \
    csrc/u8g_pb8v2.c \
    csrc/u8g_pb.c \
    csrc/u8g_pbxh16.c \
    csrc/u8g_pbxh24.c \
    csrc/u8g_polygon.c \
    csrc/u8g_rect.c \
    csrc/u8g_rot.c \
    csrc/u8g_scale.c \
    csrc/u8g_state.c \
    csrc/u8g_u16toa.c \
    csrc/u8g_u8toa.c \
    csrc/u8g_virtual_screen.c \
    sfntsrc/u8g_font_data.c \
    dogmsrc/spacetrash.c \
    $(NULL)

SRC_WPI= \
    csrc/u8g_com_i2c.c \
    csrc/u8g_com_io.c \
    csrc/u8g_com_raspberrypi_hw_spi.c \
    csrc/u8g_com_raspberrypi_ssd_i2c.c \
    csrc/u8g_ll_api.c \
    dogmsrc/u8g_dogm128_api.c \
    cppsrc/U8glib.cpp \
    $(NULL)

SRC_SDL= \
    csrc/u8g_com_i2c.c \
    csrc/u8g_com_io.c \
    csrc/u8g_ll_api.c \
    dogmsrc/u8g_dogm128_api.c \
    cppsrc/U8glib.cpp \
    sys/sdl/dev/u8g_dev_sdl.c \
    $(NULL)

include_HEADERS = \
    $(top_srcdir)/csrc/u8g.h \
    $(top_srcdir)/cppsrc/U8glib.h \
    $(top_srcdir)/dogmsrc/u8g_dogm128_api.h \
    $(top_srcdir)/nonarduino/Printable.h \
    $(top_srcdir)/nonarduino/Print.h \
    $(top_srcdir)/nonarduino/WString.h \
    $(NULL)

noinst_HEADERS=

lib_LTLIBRARIES=libu8gbase.la libu8gsdl.la libu8gwpi.la

libu8gbase_la_SOURCES=$(SRC_BASE)

libu8gsdl_la_SOURCES=$(SRC_SDL)

libu8gwpi_la_SOURCES=$(SRC_WPI)

libu8gbase_la_CFLAGS=-Icsrc -Icppsrc -Inonarduino -DU8G_16BIT `sdl-config --cflags`
libu8gbase_la_CPPFLAGS=$(libu8gbase_la_CFLAGS)
libu8gbase_la_LDFLAGS=

libu8gsdl_la_CFLAGS=-Icsrc -Icppsrc -Inonarduino -DU8G_16BIT `sdl-config --cflags`
libu8gsdl_la_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
libu8gsdl_la_LDFLAGS=$(top_builddir)/libu8gbase.la `sdl-config --libs`

libu8gwpi_la_CFLAGS=-Icsrc -Icppsrc -Inonarduino -DU8G_16BIT -DU8G_RASPBERRY_PI -DU8G_WITH_PINLIST
libu8gwpi_la_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
libu8gwpi_la_LDFLAGS=$(top_builddir)/libu8gbase.la -lwiringPi


BIN_SDL=u8gsdl_2bit u8gsdl_8bit u8gsdl_chess u8gsdl_circle u8gsdl_helloworldpp u8gsdl_cursor u8gsdl_fonttop u8gsdl_fullcolor u8gsdl_gabc u8gsdl_gah u8gsdl_greek u8gsdl_helloworld u8gsdl_hicolor u8gsdl_logo u8gsdl_menu u8gsdl_polygon u8gsdl_spacetrash u8gsdl_xbm

BIN_WPI=u8gwpi_chess u8gwpi_chessdogm u8gwpi_gtest u8gwpi_logo u8gwpi_spacetrash

bin_PROGRAMS=$(BIN_SDL)

noinst_PROGRAMS=$(BIN_WPI)

u8gsdl_2bit_SOURCES=sys/sdl/2bit/main.c
u8gsdl_2bit_CFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_2bit_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_8bit_SOURCES=sys/sdl/8bit/main.c
u8gsdl_8bit_CFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_8bit_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_chess_SOURCES=sys/sdl/chess/main.c
u8gsdl_chess_CFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_chess_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_circle_SOURCES=sys/sdl/circle/main.c
u8gsdl_circle_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_circle_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_helloworldpp_SOURCES=sys/sdl/cpp_helloworld/main.cpp
u8gsdl_helloworldpp_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_helloworldpp_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_cursor_SOURCES=sys/sdl/cursor/main.c
u8gsdl_cursor_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_cursor_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_fonttop_SOURCES=sys/sdl/FontPosTop/main.c
u8gsdl_fonttop_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_fonttop_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_fullcolor_SOURCES=sys/sdl/fullcolor/main.c
u8gsdl_fullcolor_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_fullcolor_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_gabc_SOURCES=sys/sdl/gabc/main.c
u8gsdl_gabc_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_gabc_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_gah_SOURCES=sys/sdl/gA_h/main.c
u8gsdl_gah_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_gah_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_greek_SOURCES=sys/sdl/greek/main.c
u8gsdl_greek_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_greek_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_helloworld_SOURCES=sys/sdl/helloworld/main.c
u8gsdl_helloworld_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_helloworld_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_hicolor_SOURCES=sys/sdl/hicolor/main.c
u8gsdl_hicolor_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_hicolor_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_logo_SOURCES=sys/sdl/cpp_logo/main.cpp
u8gsdl_logo_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_logo_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_menu_SOURCES=sys/sdl/menu/main.c
u8gsdl_menu_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_menu_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_polygon_SOURCES=sys/sdl/polygon/main.c
u8gsdl_polygon_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_polygon_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_spacetrash_SOURCES=sys/sdl/spacetrash/spacemain.c
u8gsdl_spacetrash_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_spacetrash_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

u8gsdl_xbm_SOURCES=sys/sdl/xbm/main.c
u8gsdl_xbm_CPPFLAGS=$(libu8gsdl_la_CFLAGS)
u8gsdl_xbm_LDFLAGS=-lu8gsdl $(libu8gsdl_la_LDFLAGS)

.pde.cpp:
	cp $< $@
.ino.o:
	cp $< $@

#u8gwpi_logo_SOURCES=sys/arm/examples/u8g_logo/u8g_logo.c
#u8gwpi_logo_SOURCES=sys/atmega/u8g_logo/u8g_logo.c
u8gwpi_logo_SOURCES=nonarduino/wpimain.cpp sys/arduino/U8gLogo/U8gLogo.pde
u8gwpi_logo_CFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_logo_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_logo_LDFLAGS=-lu8gwpi $(libu8gwpi_la_LDFLAGS)

u8gwpi_gtest_SOURCES=nonarduino/wpimain.cpp sys/arduino/GraphicsTest/GraphicsTest.pde
u8gwpi_gtest_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_gtest_LDFLAGS=-lu8gwpi $(libu8gwpi_la_LDFLAGS)

u8gwpi_spacetrash_SOURCES=nonarduino/wpimain.cpp sys/arduino/SpaceTrashDogm/SpaceTrash.pde #sys/sdl/spacetrash/spacemain.c
u8gwpi_spacetrash_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_spacetrash_LDFLAGS=-lu8gwpi $(libu8gwpi_la_LDFLAGS)

u8gwpi_chess_SOURCES=nonarduino/wpimain.cpp sys/arduino/Chess/Chess.pde
u8gwpi_chess_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_chess_LDFLAGS=-lu8gwpi $(libu8gwpi_la_LDFLAGS)

u8gwpi_chessdogm_SOURCES=nonarduino/wpimain.cpp sys/arduino/ChessDogm/Chess.pde
u8gwpi_chessdogm_CPPFLAGS=$(libu8gwpi_la_CFLAGS)
u8gwpi_chessdogm_LDFLAGS=-lu8gwpi $(libu8gwpi_la_LDFLAGS)