blob: 0793d0139c65820a83d5e9306bbd8f5ffecacf4d [file] [log] [blame]
gpz452b5bd2003-05-19 08:21:01 +00001# Copyright (c) 2002, Adam Dunkels.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions
6# are met:
7# 1. Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# 2. Redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution.
12# 3. All advertising materials mentioning features or use of this software
13# must display the following acknowledgement:
14# This product includes software developed by Adam Dunkels.
15# 4. The name of the author may not be used to endorse or promote
16# products derived from this software without specific prior
17# written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
20# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31# This file is part of the Contiki desktop environment
32#
oliverschmidtf62fb9e2005-04-18 22:44:54 +000033# $Id: Makefile,v 1.2 2005/04/18 22:44:54 oliverschmidt Exp $
gpz452b5bd2003-05-19 08:21:01 +000034#
35
36CONTIKI=../contiki
37
oliverschmidtf62fb9e2005-04-18 22:44:54 +000038include $(CONTIKI)/Makefile.common
39
gpz452b5bd2003-05-19 08:21:01 +000040# Change the target system type here
41SYS=gbc
42
43OPT=
44
45CC=/usr/local/bin/sdcc
46AS=/usr/local/bin/as-gbz80
47LD=/usr/local/bin/link-gbz80
48
49CFLAGS=-I arch/gbc -I ctk -I uip -I conf \
50 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
51 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
52 \
53 -DCTK_CONIO \
54 -I./apps -I./ctk -I./ek -I./lib -I./uip -I./arch/gb -I./arch -I.\
55 -DCTK_THEME_H="ctk-conio.h" -D__SDCC__ -D__GAMEBOY__ \
56 -DWITH_ASCII -mgbz80 -I /usr/local/share/sdcc/include \
57 -Wall -A -A --noinvariant --noinduction --callee-saves --callee-saves-bc \
58 --nojtbound --noloopreverse --int-long-reent --float-reent --no-peep \
59 --xram-movc
60
61LDFLAGS=
62AFLAGS=-g
63
64CCFLAGS=$(CFLAGS)
65ASFLAGS=$(AFLAGS)
66
67
68%.o: %.c
69 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
70 @$(AS) -o $@ $(AFLAGS) $(*).s
71
72%.o: ctk/%.c
73 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
74 @$(AS) -o $@ $(AFLAGS) $(*).s
75
76%.o: uip/%.c
77 @$(CC) -S $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
78 @$(AS) -o $@ $(AFLAGS) $(*).s
79
80%.o: $(CONTIKI)/apps/%.c
81 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
82 @$(AS) -o $@ $(AFLAGS) $(*).s
83
84%.o: $(CONTIKI)/ctk/%.c
85 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
86 @$(AS) -o $@ $(AFLAGS) $(*).s
87
88%.o: $(CONTIKI)/ek/%.c
89 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
90 @$(AS) -o $@ $(AFLAGS) $(*).s
91
92%.o: $(CONTIKI)/lib/%.c
93 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
94 @$(AS) -o $@ $(AFLAGS) $(*).s
95
96%.o: $(CONTIKI)/uip/%.c
97 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
98 @$(AS) -o $@ $(AFLAGS) $(*).s
99
gpz452b5bd2003-05-19 08:21:01 +0000100all: contiki
101
102contiki: contiki-main.o strncasecmp.o \
103 contiki.o programs.o \
104 ctk-conio.o ctk.o ek.o dispatcher.o
105
106 @cd arch;$(AS) $(ASFLAGS) -o ../crt0.o gb/crt0.s
107
108 @$(CC) $(CCFLAGS) -S arch/gb/conio.c -o conio.asm
109 @$(AS) $(ASFLAGS) -o conio.o conio.asm
110 @$(CC) $(CCFLAGS) -S arch/gb/_oserror.c -o _oserror.asm
111 @$(AS) $(ASFLAGS) -o _oserror.o _oserror.asm
112 @$(CC) $(CCFLAGS) -S arch/gb/font.c -o font.asm
113 @$(AS) $(ASFLAGS) -o font.o font.asm
114 @$(CC) $(CCFLAGS) -S arch/gb/memmove.c -o memmove.asm
115 @$(AS) $(ASFLAGS) -o memmove.o memmove.asm
116 @$(CC) $(CCFLAGS) -S arch/gb/vsprintf.c -o vsprintf.asm
117 @$(AS) $(ASFLAGS) -o vsprintf.o vsprintf.asm
118 @$(CC) $(CCFLAGS) -S arch/gb/ltostr.c -o ltostr.asm
119 @$(AS) $(ASFLAGS) -o ltostr.o ltostr.asm
120 @$(CC) $(CCFLAGS) -S arch/gb/get_tv.c -o get_tv.asm
121 @$(AS) $(ASFLAGS) -o get_tv.o get_tv.asm
122 @$(CC) $(CCFLAGS) -S arch/none/joytokbd.c -o joytokbd.asm
123 @$(AS) $(ASFLAGS) -o joytokbd.o joytokbd.asm
124
125 @cd arch;$(AS) $(ASFLAGS) -o ../init_tt.o gb/init_tt.s
126 @cd arch;$(AS) $(ASFLAGS) -o ../set_spr.o gb/set_spr.s
127 @cd arch;$(AS) $(ASFLAGS) -o ../mv_spr.o gb/mv_spr.s
128 @cd arch;$(AS) $(ASFLAGS) -o ../arand.o gb/arand.s
129 @cd arch;$(AS) $(ASFLAGS) -o ../hiramcpy.o gb/hiramcpy.s
130 @cd arch;$(AS) $(ASFLAGS) -o ../cpy_data.o gb/cpy_data.s
131 @cd arch;$(AS) $(ASFLAGS) -o ../delay.o gb/delay.s
132 @cd arch;$(AS) $(ASFLAGS) -o ../joystick.o gb/joystick.s
133 @cd arch;$(AS) $(ASFLAGS) -o ../rand.o gb/rand.s
134 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_b.o gb/scroll_b.s
135 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_s.o gb/scroll_s.s
136 @cd arch;$(AS) $(ASFLAGS) -o ../get_bk_t.o gb/get_bk_t.s
137 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_w.o gb/scroll_w.s
138 @cd arch;$(AS) $(ASFLAGS) -o ../get_data.o gb/get_data.s
139 @cd arch;$(AS) $(ASFLAGS) -o ../serial.o gb/serial.s
140 @cd arch;$(AS) $(ASFLAGS) -o ../get_prop.o gb/get_prop.s
141 @cd arch;$(AS) $(ASFLAGS) -o ../set_bk_t.o gb/set_bk_t.s
142 @cd arch;$(AS) $(ASFLAGS) -o ../set_data.o gb/set_data.s
143 @cd arch;$(AS) $(ASFLAGS) -o ../get_wi_t.o gb/get_wi_t.s
144 @cd arch;$(AS) $(ASFLAGS) -o ../set_prop.o gb/set_prop.s
145 @cd arch;$(AS) $(ASFLAGS) -o ../get_xy_t.o gb/get_xy_t.s
146 @cd arch;$(AS) $(ASFLAGS) -o ../set_wi_t.o gb/set_wi_t.s
147 @cd arch;$(AS) $(ASFLAGS) -o ../set_xy_t.o gb/set_xy_t.s
148
149 @cd arch;$(AS) $(ASFLAGS) -o ../fontms.o gb/fontms.s
150 @cd arch;$(AS) $(ASFLAGS) -o ../drawing.o gb/drawing.s
151
152 @$(LD) -- -z contiki.gb \
153 crt0.o \
154 /usr/local/share/sdcc/lib/gbz80/crt0_rle.o \
155 $^ \
156 memmove.o \
157 vsprintf.o \
158 joytokbd.o \
159 _oserror.o \
160 /usr/local/share/sdcc/lib/gbz80/_strcat.o \
161 /usr/local/share/sdcc/lib/gbz80/_strcpy.o \
162 /usr/local/share/sdcc/lib/gbz80/_strncpy.o \
163 /usr/local/share/sdcc/lib/gbz80/_strncmp.o \
164 /usr/local/share/sdcc/lib/gbz80/_strlen.o \
165 /usr/local/share/sdcc/lib/gbz80/_memcpy.o \
166 /usr/local/share/sdcc/lib/gbz80/_memset.o \
167 /usr/local/share/sdcc/lib/gbz80/_modslong.o \
168 /usr/local/share/sdcc/lib/gbz80/_divslong.o \
169 /usr/local/share/sdcc/lib/gbz80/_modulong.o \
170 /usr/local/share/sdcc/lib/gbz80/_divulong.o \
171 /usr/local/share/sdcc/lib/gbz80/_mullong.o \
172 /usr/local/share/sdcc/lib/gbz80/shift.o \
173 /usr/local/share/sdcc/lib/gbz80/mul.o \
174 /usr/local/share/sdcc/lib/gbz80/div.o \
175 /usr/local/share/sdcc/lib/gbz80/stubs.o \
176 \
177 conio.o \
178 ltostr.o \
179 get_tv.o \
180 joystick.o\
181 font.o \
182 init_tt.o\
183 set_spr.o\
184 mv_spr.o\
185 arand.o\
186 hiramcpy.o\
187 cpy_data.o \
188 delay.o \
189 drawing.o\
190 rand.o\
191 scroll_b.o\
192 scroll_s.o\
193 get_bk_t.o \
194 scroll_w.o\
195 get_data.o \
196 serial.o\
197 get_prop.o \
198 set_bk_t.o\
199 set_data.o\
200 get_wi_t.o \
201 set_prop.o\
202 get_xy_t.o \
203 set_wi_t.o\
204 set_xy_t.o\
205 fontms.o
206
207run:
208 @xgnuboy contiki.gb
209
210clean:
211 @rm -f *.o *~ *core contiki.gb *.s *.asm *.sym *.rel *.lst *.lnk *.map