blob: 5775dacc2d9596e04c7cd6ae393ad3c6fc30db99 [file] [log] [blame]
sannyx912b45f2003-04-12 02:06:45 +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# Makefile for Atari 8-bit version
32# This file is part of the Contiki desktop environment
33#
sannyx6f0c75c2003-04-14 21:31:28 +000034# $Id: Makefile,v 1.2 2003/04/14 21:31:28 sannyx Exp $
sannyx912b45f2003-04-12 02:06:45 +000035#
36
37all: contiki.com
38
39CONTIKI=../contiki
40SYS=atari
41
42CC=cc65
43AS=ca65
44CFLAGS=-I ctk -I loader -I uip -I conf -I lib \
45 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
46 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
47 -t $(SYS) --add-source -DWITH_ASCII \
48 -DCTK_CONIO -DWITH_CC65 -DWITH_UIP -DWITH_RS232 -DWITH_WWW # -DWITH_TELNET
49OPT=-Or
50
51%.o: %.c
52 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
53 $(AS) -o $@ $(AFLAGS) $(*).s
54
55%.o: apps/%.c
56 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
57 $(AS) -o $@ $(AFLAGS) $(*).s
58
59%.o: ctk/%.c
60 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
61 $(AS) -o $@ $(AFLAGS) $(*).s
62
63%.o: lib/%.c
64 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
65 $(AS) -o $@ $(AFLAGS) $(*).s
66
67%.o: loader/%.c
68 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
69 $(AS) -o $@ $(AFLAGS) $(*).s
70
71%.o: uip/%.c
72 $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
73 $(AS) -o $@ $(AFLAGS) $(*).s
74
75%.o: $(CONTIKI)/apps/%.c
76 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
77 $(AS) -o $@ $(AFLAGS) $(*).s
78
79%.o: $(CONTIKI)/ctk/%.c
80 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
81 $(AS) -o $@ $(AFLAGS) $(*).s
82
83%.o: $(CONTIKI)/ek/%.c
84 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
85 $(AS) -o $@ $(AFLAGS) $(*).s
86
87%.o: $(CONTIKI)/lib/%.c
88 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
89 $(AS) -o $@ $(AFLAGS) $(*).s
90
91%.o: $(CONTIKI)/uip/%.c
92 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
93 $(AS) -o $@ $(AFLAGS) $(*).s
94
95
96%.o: ctk/%.S
97 $(AS) -o $@ $(AFLAGS) $<
98
99%.o: loader/%.S
100 $(AS) -o $@ $(AFLAGS) $<
101
102UIP=uip.o uip_arch.o uip_main.o resolv.o
103WWW=www.o webclient.o http-strings.o htmlparser.o html-strings.o
104EMAIL=email.o smtp.o smtp-strings.o
105WEBSERVER=webserver.o http-strings.o
106TELNET=simpletelnet.o telnet.o
107
108contiki.com: contiki-main.o strncasecmp.o petsciiconv.o \
109 ctk-conio.o ctk.o ek.o dispatcher.o \
110 program-handler.o $(WWW) $(UIP) rs232dev.o \
111 about.o netconf.o processes.o
112 cl65 -C atari.cfg -Ln contiki-labels -o $@ -t $(SYS) $^
113 @if [ ! -f Makefile.depend ]; then \
114 echo ; \
115 echo "*** warning: you didn't make depend, result may be unaccurate!"; \
116 echo ; \
117 fi
118
119clean:
120 rm -f *.o *~ *core contiki *.s *.prg contiki-labels contiki.com Makefile.depend
121
122depend:
sannyx6f0c75c2003-04-14 21:31:28 +0000123 gcc -MM -MG -Iapps -Ictk -Iuip -Iconf -Ilib -I$(CC65_INC) \
sannyx912b45f2003-04-12 02:06:45 +0000124 -I$(CONTIKI)/lib -I$(CONTIKI)/ek \
125 -I$(CONTIKI)/ctk -I$(CONTIKI)/apps -I$(CONTIKI)/uip \
126 *.c */*.c $(CONTIKI)/*/*.c > Makefile.depend
127
128-include Makefile.depend
129
130codesize:
131 od65 --dump-segsize *.o | egrep '\.o|CODE'