blob: 6591968d2989d25d68c30c8a15a65a0b5b638f48 [file] [log] [blame]
gpzea72b402003-05-19 09:18:10 +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 09:18:10 gpz Exp $
34#
35
36CONTIKI=../contiki
37
38# Change the target system type here
39#SYS=pce
40SYS=none
41
42CC=cc65
43AS=ca65
44CFLAGS=-I arch/pcengine -I ctk -I uip -I conf \
45 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
46 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
47 -t $(SYS) --add-source --cpu 65C02 \
48 -D __PCENGINE__ -DCTK_CONIO
49OPT=-Or
50%.o: %.c
51 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
52 $(AS) -o $@ $(AFLAGS) $(*).s
53
54%.o: ctk/%.c
55 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
56 $(AS) -o $@ $(AFLAGS) $(*).s
57
58%.o: uip/%.c
59 $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
60 $(AS) -o $@ $(AFLAGS) $(*).s
61
62%.o: $(CONTIKI)/apps/%.c
63 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
64 $(AS) -o $@ $(AFLAGS) $(*).s
65
66%.o: $(CONTIKI)/ctk/%.c
67 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
68 $(AS) -o $@ $(AFLAGS) $(*).s
69
70%.o: $(CONTIKI)/ek/%.c
71 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
72 $(AS) -o $@ $(AFLAGS) $(*).s
73
74%.o: $(CONTIKI)/lib/%.c
75 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
76 $(AS) -o $@ $(AFLAGS) $(*).s
77
78%.o: $(CONTIKI)/uip/%.c
79 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
80 $(AS) -o $@ $(AFLAGS) $(*).s
81
82
83WWW=www.o webclient.o http-strings.o htmlparser.o html-strings.o
84EMAIL=email.o smtp.o smtp-strings.o
85
86# needed for zeropage.inc, joy-kernel.inc etc
87CC65_ASMINC=/usr/lib/cc65/asminc
88export CC65_ASMINC
89CCFLAGS+=--asm-include-dir $(CC65_ASMINC)
90
91#CC65_INCLUDE=/usr/lib/cc65/include
92#export CC65_INC
93
94# location of the joystick drivers
95# not yet :)
96#JOYDRV=/usr/lib/cc65/joy
97
98#OPTFLAGS=-Or
99#CCFLAGS+=$(OPTFLAGS)
100CAFLAGS=--cpu 65C02 -D___PCENGINE__ -I arch/ -I arch/pcengine -t none
101#CCFLAGS=-g --mapfile main.map
102
103contiki: contiki-main.o strncasecmp.o petsciiconv.o \
104 contiki.o programs.o \
105 ctk-conio.o ctk.o ek.o dispatcher.o
106 @ca65 $(CAFLAGS) -o chline.o arch/conio/chline.s
107 @ca65 $(CAFLAGS) -o cvline.o arch/conio/cvline.s
108 @ca65 $(CAFLAGS) -o cclear.o arch/conio/cclear.s
109 @ca65 $(CAFLAGS) -o where.o arch/conio/where.s
110 @ca65 $(CAFLAGS) -o gotoxy.o arch/conio/gotoxy.s
111 @ca65 $(CAFLAGS) -o revers.o arch/conio/revers.s
112 @ca65 $(CAFLAGS) -o oserrlist.o arch/none/oserrlist.s
113 @ca65 $(CAFLAGS) -o ctype.o arch/none/ctype.s
114 @ca65 $(CAFLAGS) -o crt0.o arch/pcengine/crt0.s
115 @ca65 $(CAFLAGS) -o psg.o arch/pcengine/psg.s
116 @ca65 $(CAFLAGS) -o vce.o arch/pcengine/vce.s
117 @ca65 $(CAFLAGS) -o vdc.o arch/pcengine/vdc.s
118 @ca65 $(CAFLAGS) -o conio.o arch/pcengine/conio.s
119 @ca65 $(CAFLAGS) -o color.o arch/pcengine/color.s
120 @ca65 $(CAFLAGS) -o kplot.o arch/pcengine/kplot.s
121 @ca65 $(CAFLAGS) -o cputc.o arch/pcengine/cputc.s
122 @ca65 $(CAFLAGS) -o clock.o arch/pcengine/clock.s
123 @ca65 $(CAFLAGS) -o clrscr.o arch/pcengine/clrscr.s
124 @ca65 $(CAFLAGS) -o _scrsize.o arch/pcengine/_scrsize.s
125 @ca65 $(CAFLAGS) -o pce-stdjoy.o arch/pcengine/pce-stdjoy.s
126 @cl65 --cpu 65C02 $(CFLAGS) --asm-include-dir ./arch/pcengine \
127 -o contiki.pce -t none -C arch/pcengine/pcengine.x -D__PCENGINE__ \
128 arch/pcengine/crt0.s $^ \
129 arch/none/joytokbd.c \
130 chline.o \
131 cvline.o \
132 cclear.o \
133 where.o \
134 gotoxy.o \
135 psg.o \
136 vce.o \
137 vdc.o \
138 conio.o \
139 color.o \
140 revers.o \
141 kplot.o \
142 cputc.o \
143 clock.o \
144 clrscr.o \
145 _scrsize.o \
146 pce-stdjoy.o \
147 oserrlist.o \
148 ctype.o \
149 arch/pcengine/none65C02.lib
150
151clean:
152 rm -f *.o *~ *core contiki.pce *.s
153 rm -f arch/conio/*.o
154 rm -f arch/none/*.o
155 rm -f arch/pcengine/*.o