summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/nds/Makefile.am
blob: ac712dac53759b2e082a23e63b9a407c0b481f1c (plain) (blame)
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
##
## $Id$
##

ACLOCAL_AMFLAGS = -I ../../../../aclocal

SUBDIRS = . tools

include $(top_srcdir)/../../../../automake/compile.am

include_bspdir = $(includedir)/bsp

dist_project_lib_DATA = bsp_specs

include_HEADERS = include/bsp.h
include_HEADERS += ../../shared/include/tm27.h

nodist_include_HEADERS = include/bspopts.h
nodist_include_HEADERS += ../../shared/include/coverhd.h

nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
DISTCLEANFILES = include/bspopts.h
noinst_PROGRAMS =

noinst_LIBRARIES = libbspstart.a
libbspstart_a_SOURCES = start/start.S
project_lib_DATA = start.$(OBJEXT)

dist_project_lib_DATA += startup/linkcmds

noinst_LIBRARIES += libbsp.a
libbsp_a_SOURCES =

include_ndsdir = $(includedir)/nds
include_nds_HEADERS = touchscreen/touchscreen.h sound/sound.h

noinst_PROGRAMS += startup.rel
startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
    startup/bspstart.c ../../shared/bspclean.c startup/bspreset.c \
    ../../shared/bspgetworkarea.c ../../shared/bsppredriverhook.c \
    ../../shared/bsppretaskinghook.c ../../shared/bootcard.c
startup_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += gnatsupp.rel
gnatsupp_rel_SOURCES = ../../shared/gnatinstallhandler.c
gnatsupp_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
gnatsupp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += clock.rel
clock_rel_SOURCES = clock/clock.c
clock_rel_SOURCES += ../../shared/clockdrv_shell.h
clock_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += rtc.rel
rtc_rel_SOURCES = rtc/rtc.c ../../shared/tod.c
rtc_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
rtc_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += console.rel
console_rel_SOURCES = console/console.c
console_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include -I$(srcdir)/include
console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += fb.rel
fb_rel_SOURCES = fb/fb.c
fb_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
fb_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += touchscreen.rel
touchscreen_rel_SOURCES = touchscreen/touchscreen.c touchscreen/parser.c \
			  touchscreen/reco.c
touchscreen_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
touchscreen_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += timer.rel
timer_rel_SOURCES = timer/timer.c
timer_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += sound.rel
sound_rel_SOURCES = sound/sound.c
sound_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
sound_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += block.rel
block_rel_SOURCES = block/block.c
block_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include -DNDS -I$(srcdir)/libfat/source/disc_io
block_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

noinst_PROGRAMS += irq.rel
irq_rel_SOURCES = irq/irq.c
irq_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

if HAS_NETWORKING
noinst_PROGRAMS += wifi.rel
wifi_rel_SOURCES =	wifi/wifi.c					\
			wifi/compat.c
wifi_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/dswifi/include -I$(srcdir)/libnds/include -I$(srcdir)/dswifi/include -D_KERNEL -D__BSD_VISIBLE
wifi_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif

# libnds, ARM9 side
noinst_PROGRAMS += libnds9.rel
bin2s:	$(srcdir)/tools/bin2s.c
	cc -o $(srcdir)/tools/bin2s $(srcdir)/tools/bin2s.c

SUFFIXES = .bin

%.s:	%.bin bin2s
	$(srcdir)/tools/bin2s $< > $(srcdir)/$@

libnds9_rel_SOURCES =  	libnds/source/common/biosCalls.S		\
			libnds/source/common/card.c			\
			libnds/source/common/gbfs.c			\
			libnds/source/common/interruptDispatcher.S	\
			libnds/source/common/interrupts.c		\
			libnds/source/arm9/boxtest.c			\
			libnds/source/arm9/default_font.S		\
			libnds/source/arm9/console.c			\
			libnds/source/arm9/COS.S			\
			libnds/source/arm9/dcache.S			\
			libnds/source/arm9/exceptionHandler.S		\
			libnds/source/arm9/exceptions.c			\
			libnds/source/arm9/gurumeditation.c		\
			libnds/source/arm9/icache.S			\
			libnds/source/arm9/image.c			\
			libnds/source/arm9/initSystem.c			\
			libnds/source/arm9/keys.c			\
			libnds/source/arm9/ndsmotion.c			\
			libnds/source/arm9/pcx.c			\
			libnds/source/arm9/rumble.c			\
			libnds/source/arm9/SIN.S			\
			libnds/source/arm9/sound.c			\
			libnds/source/arm9/system.c			\
			libnds/source/arm9/TAN.S			\
			libnds/source/arm9/touch.c			\
			libnds/source/arm9/video.c			\
			libnds/source/arm9/videoGL.c
libnds9_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include -I$(srcdir)/include
libnds9_rel_CCASFLAGS = $(AM_CCASFLAGS) -DARM9 -I$(srcdir)/libnds/include
libnds9_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

if HAS_NETWORKING
# dswifi, ARM9 side
noinst_PROGRAMS += dswifi9.rel
dswifi9_rel_SOURCES =  	dswifi/arm9/source/wifi_arm9.c			\
			dswifi/common/source/spinlock.S
dswifi9_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/dswifi/include -I$(srcdir)/libnds/include -I$(srcdir)/dswifi/common/source -I$(srcdir)/wifi -D_KERNEL
dswifi9_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif

# dldi
noinst_PROGRAMS += libdldi.rel
libdldi_rel_SOURCES =  	libfat/source/disc_io/disc.c			\
			libfat/source/disc_io/io_cf_common.c		\
			libfat/source/disc_io/io_efa2.c			\
			libfat/source/disc_io/io_fcsr.c			\
			libfat/source/disc_io/io_m3cf.c			\
			libfat/source/disc_io/io_m3_common.c		\
			libfat/source/disc_io/io_m3sd.c			\
			libfat/source/disc_io/io_mpcf.c			\
			libfat/source/disc_io/io_njsd.c			\
			libfat/source/disc_io/io_nmmc.c			\
			libfat/source/disc_io/io_sccf.c			\
			libfat/source/disc_io/io_sc_common.c		\
			libfat/source/disc_io/io_scsd.c			\
			libfat/source/disc_io/io_sd_common.c		\
			libfat/source/disc_io/io_dldi.S			\
			libfat/source/disc_io/io_scsd_s.S
libdldi_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include -I$(srcdir)/libfat/source/disc_io
libdldi_rel_CCASFLAGS = $(AM_CCASFLAGS) -DARM9 -I$(srcdir)/libnds/include -I$(srcdir)/libfat/source/disc_io
libdldi_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

# libnds, ARM7 side
noinst_PROGRAMS += libnds7.rel
libnds7_rel_SOURCES =   libnds/source/common/biosCalls.S		\
			libnds/source/common/card.c			\
			libnds/source/common/gbfs.c			\
			libnds/source/common/interruptDispatcher.S	\
			libnds/source/common/interrupts.c		\
			libnds/source/arm7/audio.c			\
			libnds/source/arm7/clock.c			\
			libnds/source/arm7/microphone.c			\
			libnds/source/arm7/spi.c			\
			libnds/source/arm7/touch.c			\
			libnds/source/arm7/userSettings.c
libnds7_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM7 -I$(srcdir)/libnds/include
libnds7_rel_CFLAGS = -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft
libnds7_rel_CCASFLAGS = -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft
libnds7_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

if HAS_NETWORKING
# dswifi, ARM7 side
noinst_PROGRAMS += dswifi7.rel
dswifi7_rel_SOURCES =  	dswifi/arm7/source/wifi_arm7.c			\
			dswifi/common/source/spinlock.S
dswifi7_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM7 -I$(srcdir)/dswifi/include -I$(srcdir)/libnds/include -I$(srcdir)/dswifi/common/source
dswifi7_rel_CFLAGS = -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft
dswifi7_rel_CCASFLAGS = -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft
dswifi7_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif

# include libnds to dist so the user program can include it
include_libndsdir = $(includedir)/libnds
include_libnds_HEADERS =	libnds/include/gbfs.h			\
				libnds/include/nds.h

include_libndsndsdir = $(includedir)/libnds/nds
include_libndsnds_HEADERS =	libnds/include/nds/memory.h		\
				libnds/include/nds/system.h		\
				libnds/include/nds/bios.h		\
				libnds/include/nds/registers_alt.h	\
				libnds/include/nds/interrupts.h		\
				libnds/include/nds/card.h		\
				libnds/include/nds/ipc.h		\
				libnds/include/nds/timers.h		\
				libnds/include/nds/dma.h		\
				libnds/include/nds/reload.h		\
				libnds/include/nds/jtypes.h

include_libndsnds9dir = $(includedir)/libnds/nds/arm9
include_libndsnds9_HEADERS =	libnds/include/nds/arm9/ndsmotion.h	\
				libnds/include/nds/arm9/pcx.h		\
				libnds/include/nds/arm9/input.h		\
				libnds/include/nds/arm9/math.h		\
				libnds/include/nds/arm9/console.h	\
				libnds/include/nds/arm9/sprite.h	\
				libnds/include/nds/arm9/videoGL.h	\
				libnds/include/nds/arm9/cache.h		\
				libnds/include/nds/arm9/image.h		\
				libnds/include/nds/arm9/trig_lut.h	\
				libnds/include/nds/arm9/video.h		\
				libnds/include/nds/arm9/exceptions.h	\
				libnds/include/nds/arm9/rumble.h	\
				libnds/include/nds/arm9/background.h	\
				libnds/include/nds/arm9/boxtest.h	\
				libnds/include/nds/arm9/postest.h	\
				libnds/include/nds/arm9/sound.h

include_libndsnds7dir = $(includedir)/libnds/nds/arm7
include_libndsnds7_HEADERS =	libnds/include/nds/arm7/serial.h	\
				libnds/include/nds/arm7/audio.h		\
				libnds/include/nds/arm7/clock.h		\
				libnds/include/nds/arm7/touch.h
EXTRA_DIST = coproc/coproc.S coproc/coproc.c
if HAS_NETWORKING
coproc.bin: coproc/coproc.S coproc/coproc.c libnds7.rel dswifi7.rel
	@CC@ -o coproc.elf -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft -O2 -DARM7 -I$(srcdir)/libnds/include -I$(srcdir)/dswifi/include -DENABLE_WIFI -T $(srcdir)/coproc/coproc.ld $^ -lc
	$(OBJCOPY) -O binary coproc.elf coproc.bin
else
coproc.bin: coproc/coproc.S coproc/coproc.c libnds7.rel
	@CC@ -o coproc.elf -mcpu=arm7tdmi -mfpu=vfp -mfloat-abi=soft -O2 -DARM7 -I$(srcdir)/libnds/include -T $(srcdir)/coproc/coproc.ld $^ -lc
	$(OBJCOPY) -O binary coproc.elf coproc.bin
endif
project_lib_DATA += coproc.bin

libbsp_a_LIBADD = clock.rel console.rel gnatsupp.rel startup.rel irq.rel \
    timer.rel libnds9.rel rtc.rel fb.rel touchscreen.rel sound.rel \
    block.rel libdldi.rel

if HAS_NETWORKING
    libbsp_a_LIBADD += wifi.rel dswifi9.rel
endif

include $(srcdir)/preinstall.am
include $(top_srcdir)/../../../../automake/local.am