blob: f1399ae4c2f0c529eefbe0d0b59e4b6513eb2708 [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#
33# $Id: Makefile,v 1.1 2003/05/19 08:21:01 gpz Exp $
34#
35
36CONTIKI=../contiki
37
38# Change the target system type here
39SYS=gbc
40
41OPT=
42
43CC=/usr/local/bin/sdcc
44AS=/usr/local/bin/as-gbz80
45LD=/usr/local/bin/link-gbz80
46
47CFLAGS=-I arch/gbc -I ctk -I uip -I conf \
48 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
49 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
50 \
51 -DCTK_CONIO \
52 -I./apps -I./ctk -I./ek -I./lib -I./uip -I./arch/gb -I./arch -I.\
53 -DCTK_THEME_H="ctk-conio.h" -D__SDCC__ -D__GAMEBOY__ \
54 -DWITH_ASCII -mgbz80 -I /usr/local/share/sdcc/include \
55 -Wall -A -A --noinvariant --noinduction --callee-saves --callee-saves-bc \
56 --nojtbound --noloopreverse --int-long-reent --float-reent --no-peep \
57 --xram-movc
58
59LDFLAGS=
60AFLAGS=-g
61
62CCFLAGS=$(CFLAGS)
63ASFLAGS=$(AFLAGS)
64
65
66%.o: %.c
67 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
68 @$(AS) -o $@ $(AFLAGS) $(*).s
69
70%.o: ctk/%.c
71 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
72 @$(AS) -o $@ $(AFLAGS) $(*).s
73
74%.o: uip/%.c
75 @$(CC) -S $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
76 @$(AS) -o $@ $(AFLAGS) $(*).s
77
78%.o: $(CONTIKI)/apps/%.c
79 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
80 @$(AS) -o $@ $(AFLAGS) $(*).s
81
82%.o: $(CONTIKI)/ctk/%.c
83 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
84 @$(AS) -o $@ $(AFLAGS) $(*).s
85
86%.o: $(CONTIKI)/ek/%.c
87 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
88 @$(AS) -o $@ $(AFLAGS) $(*).s
89
90%.o: $(CONTIKI)/lib/%.c
91 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
92 @$(AS) -o $@ $(AFLAGS) $(*).s
93
94%.o: $(CONTIKI)/uip/%.c
95 @$(CC) -S $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
96 @$(AS) -o $@ $(AFLAGS) $(*).s
97
98
99UIP=uip.o uip_arch.o uip_main.o resolv.o
100WWW=www.o webclient.o http-strings.o htmlparser.o html-strings.o
101EMAIL=email.o smtp.o smtp-strings.o
102TELNET=simpletelnet.o telnet.o
103
104#cbm only :(
105#WEBSERVER=webserver.o http-strings.o
106#VNC=vnc.o vnc-viewer.o vnc-draw.o vnc-draw-asm.o
107
108all: contiki
109
110contiki: contiki-main.o strncasecmp.o \
111 contiki.o programs.o \
112 ctk-conio.o ctk.o ek.o dispatcher.o
113
114 @cd arch;$(AS) $(ASFLAGS) -o ../crt0.o gb/crt0.s
115
116 @$(CC) $(CCFLAGS) -S arch/gb/conio.c -o conio.asm
117 @$(AS) $(ASFLAGS) -o conio.o conio.asm
118 @$(CC) $(CCFLAGS) -S arch/gb/_oserror.c -o _oserror.asm
119 @$(AS) $(ASFLAGS) -o _oserror.o _oserror.asm
120 @$(CC) $(CCFLAGS) -S arch/gb/font.c -o font.asm
121 @$(AS) $(ASFLAGS) -o font.o font.asm
122 @$(CC) $(CCFLAGS) -S arch/gb/memmove.c -o memmove.asm
123 @$(AS) $(ASFLAGS) -o memmove.o memmove.asm
124 @$(CC) $(CCFLAGS) -S arch/gb/vsprintf.c -o vsprintf.asm
125 @$(AS) $(ASFLAGS) -o vsprintf.o vsprintf.asm
126 @$(CC) $(CCFLAGS) -S arch/gb/ltostr.c -o ltostr.asm
127 @$(AS) $(ASFLAGS) -o ltostr.o ltostr.asm
128 @$(CC) $(CCFLAGS) -S arch/gb/get_tv.c -o get_tv.asm
129 @$(AS) $(ASFLAGS) -o get_tv.o get_tv.asm
130 @$(CC) $(CCFLAGS) -S arch/none/joytokbd.c -o joytokbd.asm
131 @$(AS) $(ASFLAGS) -o joytokbd.o joytokbd.asm
132
133 @cd arch;$(AS) $(ASFLAGS) -o ../init_tt.o gb/init_tt.s
134 @cd arch;$(AS) $(ASFLAGS) -o ../set_spr.o gb/set_spr.s
135 @cd arch;$(AS) $(ASFLAGS) -o ../mv_spr.o gb/mv_spr.s
136 @cd arch;$(AS) $(ASFLAGS) -o ../arand.o gb/arand.s
137 @cd arch;$(AS) $(ASFLAGS) -o ../hiramcpy.o gb/hiramcpy.s
138 @cd arch;$(AS) $(ASFLAGS) -o ../cpy_data.o gb/cpy_data.s
139 @cd arch;$(AS) $(ASFLAGS) -o ../delay.o gb/delay.s
140 @cd arch;$(AS) $(ASFLAGS) -o ../joystick.o gb/joystick.s
141 @cd arch;$(AS) $(ASFLAGS) -o ../rand.o gb/rand.s
142 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_b.o gb/scroll_b.s
143 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_s.o gb/scroll_s.s
144 @cd arch;$(AS) $(ASFLAGS) -o ../get_bk_t.o gb/get_bk_t.s
145 @cd arch;$(AS) $(ASFLAGS) -o ../scroll_w.o gb/scroll_w.s
146 @cd arch;$(AS) $(ASFLAGS) -o ../get_data.o gb/get_data.s
147 @cd arch;$(AS) $(ASFLAGS) -o ../serial.o gb/serial.s
148 @cd arch;$(AS) $(ASFLAGS) -o ../get_prop.o gb/get_prop.s
149 @cd arch;$(AS) $(ASFLAGS) -o ../set_bk_t.o gb/set_bk_t.s
150 @cd arch;$(AS) $(ASFLAGS) -o ../set_data.o gb/set_data.s
151 @cd arch;$(AS) $(ASFLAGS) -o ../get_wi_t.o gb/get_wi_t.s
152 @cd arch;$(AS) $(ASFLAGS) -o ../set_prop.o gb/set_prop.s
153 @cd arch;$(AS) $(ASFLAGS) -o ../get_xy_t.o gb/get_xy_t.s
154 @cd arch;$(AS) $(ASFLAGS) -o ../set_wi_t.o gb/set_wi_t.s
155 @cd arch;$(AS) $(ASFLAGS) -o ../set_xy_t.o gb/set_xy_t.s
156
157 @cd arch;$(AS) $(ASFLAGS) -o ../fontms.o gb/fontms.s
158 @cd arch;$(AS) $(ASFLAGS) -o ../drawing.o gb/drawing.s
159
160 @$(LD) -- -z contiki.gb \
161 crt0.o \
162 /usr/local/share/sdcc/lib/gbz80/crt0_rle.o \
163 $^ \
164 memmove.o \
165 vsprintf.o \
166 joytokbd.o \
167 _oserror.o \
168 /usr/local/share/sdcc/lib/gbz80/_strcat.o \
169 /usr/local/share/sdcc/lib/gbz80/_strcpy.o \
170 /usr/local/share/sdcc/lib/gbz80/_strncpy.o \
171 /usr/local/share/sdcc/lib/gbz80/_strncmp.o \
172 /usr/local/share/sdcc/lib/gbz80/_strlen.o \
173 /usr/local/share/sdcc/lib/gbz80/_memcpy.o \
174 /usr/local/share/sdcc/lib/gbz80/_memset.o \
175 /usr/local/share/sdcc/lib/gbz80/_modslong.o \
176 /usr/local/share/sdcc/lib/gbz80/_divslong.o \
177 /usr/local/share/sdcc/lib/gbz80/_modulong.o \
178 /usr/local/share/sdcc/lib/gbz80/_divulong.o \
179 /usr/local/share/sdcc/lib/gbz80/_mullong.o \
180 /usr/local/share/sdcc/lib/gbz80/shift.o \
181 /usr/local/share/sdcc/lib/gbz80/mul.o \
182 /usr/local/share/sdcc/lib/gbz80/div.o \
183 /usr/local/share/sdcc/lib/gbz80/stubs.o \
184 \
185 conio.o \
186 ltostr.o \
187 get_tv.o \
188 joystick.o\
189 font.o \
190 init_tt.o\
191 set_spr.o\
192 mv_spr.o\
193 arand.o\
194 hiramcpy.o\
195 cpy_data.o \
196 delay.o \
197 drawing.o\
198 rand.o\
199 scroll_b.o\
200 scroll_s.o\
201 get_bk_t.o \
202 scroll_w.o\
203 get_data.o \
204 serial.o\
205 get_prop.o \
206 set_bk_t.o\
207 set_data.o\
208 get_wi_t.o \
209 set_prop.o\
210 get_xy_t.o \
211 set_wi_t.o\
212 set_xy_t.o\
213 fontms.o
214
215run:
216 @xgnuboy contiki.gb
217
218clean:
219 @rm -f *.o *~ *core contiki.gb *.s *.asm *.sym *.rel *.lst *.lnk *.map