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