blob: 0357534dcef2790eb4b01a65c570fb9245bc298d [file] [log] [blame]
adamdunkels4fa940f2003-04-11 20:30:14 +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.
adamdunkels503df8d2004-07-04 20:01:15 +000012# 3. The name of the author may not be used to endorse or promote
adamdunkels4fa940f2003-04-11 20:30:14 +000013# products derived from this software without specific prior
14# written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# This file is part of the Contiki desktop environment
29#
oliverschmidt72f2ffc2005-04-27 23:50:01 +000030# $Id: Makefile,v 1.5 2005/04/27 23:50:01 oliverschmidt Exp $
adamdunkels4fa940f2003-04-11 20:30:14 +000031#
32
33all: contiki loader-arch-module.o contiki-labels.o \
34 about.prg processes.prg netconf.prg memstat.prg \
oliverschmidtc8d16582004-12-24 15:16:53 +000035 www.prg email.prg telnet.prg vnc.prg
adamdunkels4fa940f2003-04-11 20:30:14 +000036
37CONTIKI=../contiki
adamdunkels503df8d2004-07-04 20:01:15 +000038CONTIKICC65=../contiki-cc65
adamdunkels4fa940f2003-04-11 20:30:14 +000039SYS=plus4
40
oliverschmidteeea7b72005-04-18 22:46:49 +000041include $(CONTIKI)/Makefile.common
42
adamdunkels4fa940f2003-04-11 20:30:14 +000043CC=cc65
44AS=ca65
45CFLAGS=-I apps -I ctk -I loader -I uip -I conf \
46 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
47 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
48 -t $(SYS) --add-source -DWITH_LOADER_ARCH -DWITH_UIP \
49 -DWITH_WWW -DWITH_EMAIL -DWITH_TELNET
50OPT=-Or
51
52%.o: %.c
53 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
54 $(AS) -o $@ $(AFLAGS) $(*).s
55
56%.o: apps/%.c
57 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
58 $(AS) -o $@ $(AFLAGS) $(*).s
59
60%.o: ctk/%.c
61 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
62 $(AS) -o $@ $(AFLAGS) $(*).s
63
64%.o: loader/%.c
65 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
66 $(AS) -o $@ $(AFLAGS) $(*).s
67
68%.o: uip/%.c
69 $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
70 $(AS) -o $@ $(AFLAGS) $(*).s
71
72%.o: $(CONTIKI)/apps/%.c
73 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
74 $(AS) -o $@ $(AFLAGS) $(*).s
75
76%.o: $(CONTIKI)/ctk/%.c
77 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
78 $(AS) -o $@ $(AFLAGS) $(*).s
79
80%.o: $(CONTIKI)/ek/%.c
81 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
82 $(AS) -o $@ $(AFLAGS) $(*).s
83
84%.o: $(CONTIKI)/lib/%.c
85 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
86 $(AS) -o $@ $(AFLAGS) $(*).s
87
88%.o: $(CONTIKI)/uip/%.c
89 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
90 $(AS) -o $@ $(AFLAGS) $(*).s
91
adamdunkels503df8d2004-07-04 20:01:15 +000092%.o: $(CONTIKICC65)/apps/%.c
93 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
94 $(AS) -o $@ $(AFLAGS) $(*).s
95
adamdunkels4fa940f2003-04-11 20:30:14 +000096
97%.o: apps/%.S
98 $(AS) -o $@ $(AFLAGS) $<
99
100%.o: ctk/%.S
101 $(AS) -o $@ $(AFLAGS) $<
102
103%.o: loader/%.S
104 $(AS) -o $@ $(AFLAGS) $<
105
106%.prg: %.o contiki-labels.o
107 cl65 --module -t $(SYS) -o $@ loader-arch-module.o $^
108
oliverschmidteeea7b72005-04-18 22:46:49 +0000109email.prg: $(EMAIL) lc-asm.o
adamdunkels4fa940f2003-04-11 20:30:14 +0000110www.prg: $(WWW)
oliverschmidtc8d16582004-12-24 15:16:53 +0000111telnet.prg: $(TELNET)
adamdunkels4fa940f2003-04-11 20:30:14 +0000112vnc.prg: $(VNC)
113
114contiki-labels.o: contiki-labels.s
115 ca65 -o contiki-labels.o contiki-labels.s
116contiki-labels.s: contiki
adamdunkels503df8d2004-07-04 20:01:15 +0000117 $(CONTIKICC65)/make-labels
adamdunkels4fa940f2003-04-11 20:30:14 +0000118
119contiki: contiki-main.o strncasecmp.o petsciiconv.o \
adamdunkels503df8d2004-07-04 20:01:15 +0000120 ctk-conio.o ctk.o ek.o ek-service.o arg.o timer.o \
121 uip.o uip_arch.o resolv.o uiplib.o tcpip.o \
adamdunkels4fa940f2003-04-11 20:30:14 +0000122 program-handler.o loader-arch.o
123 cl65 -Ln contiki-labels -o contiki -t $(SYS) $^
124
125
126clean:
127 rm -f *.o *~ *core contiki *.s *.prg
128
adamdunkels4fa940f2003-04-11 20:30:14 +0000129codesize:
130 od65 --dump-segsize *.o | egrep '\.o|CODE'