blob: d6dbdbc69b1ff4be59cb7b040d42a75a6584b770 [file] [log] [blame]
adamdunkels4b0459d2003-04-05 12:35:32 +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#
adamdunkels37bb23d2003-04-08 20:10:07 +000033# $Id: Makefile,v 1.2 2003/04/08 20:10:07 adamdunkels Exp $
adamdunkels4b0459d2003-04-05 12:35:32 +000034#
35
adamdunkels37bb23d2003-04-08 20:10:07 +000036all: contiki loader-arch-module.o contiki-labels.o \
37 about.prg processes.prg \
38 netconf.prg memstat.prg
39
adamdunkels4b0459d2003-04-05 12:35:32 +000040CONTIKI=../contiki
41SYS=vic20
42
43CC=cc65
44AS=ca65
adamdunkels37bb23d2003-04-08 20:10:07 +000045CFLAGS=-I ctk -I loader -I uip -I conf \
adamdunkels4b0459d2003-04-05 12:35:32 +000046 -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \
47 -I $(CONTIKI)/lib -I $(CONTIKI)/uip \
adamdunkels37bb23d2003-04-08 20:10:07 +000048 -t $(SYS) --add-source -DWITH_LOADER_ARCH
adamdunkels4b0459d2003-04-05 12:35:32 +000049OPT=-Or
50
51%.o: %.c
52 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
53 $(AS) -o $@ $(AFLAGS) $(*).s
54
adamdunkels37bb23d2003-04-08 20:10:07 +000055%.o: apps/%.c
56 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
57 $(AS) -o $@ $(AFLAGS) $(*).s
58
adamdunkels4b0459d2003-04-05 12:35:32 +000059%.o: ctk/%.c
60 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
61 $(AS) -o $@ $(AFLAGS) $(*).s
62
adamdunkels37bb23d2003-04-08 20:10:07 +000063%.o: loader/%.c
64 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
65 $(AS) -o $@ $(AFLAGS) $(*).s
66
adamdunkels4b0459d2003-04-05 12:35:32 +000067%.o: uip/%.c
68 $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
69 $(AS) -o $@ $(AFLAGS) $(*).s
70
71%.o: $(CONTIKI)/apps/%.c
72 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
73 $(AS) -o $@ $(AFLAGS) $(*).s
74
75%.o: $(CONTIKI)/ctk/%.c
76 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
77 $(AS) -o $@ $(AFLAGS) $(*).s
78
79%.o: $(CONTIKI)/ek/%.c
80 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
81 $(AS) -o $@ $(AFLAGS) $(*).s
82
83%.o: $(CONTIKI)/lib/%.c
84 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
85 $(AS) -o $@ $(AFLAGS) $(*).s
86
87%.o: $(CONTIKI)/uip/%.c
88 $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $<
89 $(AS) -o $@ $(AFLAGS) $(*).s
90
91
92%.o: ctk/%.S
93 $(AS) -o $@ $(AFLAGS) $<
94
adamdunkels37bb23d2003-04-08 20:10:07 +000095%.o: loader/%.S
96 $(AS) -o $@ $(AFLAGS) $<
97
98%.prg: %.o contiki-labels.o
99 cl65 --module -t c64 -o $@ loader-arch-module.o $^
100
adamdunkels4b0459d2003-04-05 12:35:32 +0000101
102UIP=uip.o uip_arch.o uip_main.o resolv.o
103
104WWW=www.o webclient.o http-strings.o htmlparser.o html-strings.o
105EMAIL=email.o smtp.o smtp-strings.o
106WEBSERVER=webserver.o http-strings.o
107TELNET=simpletelnet.o telnet.o
108
adamdunkels37bb23d2003-04-08 20:10:07 +0000109contiki-labels.o: contiki-labels.s
110 ca65 -o contiki-labels.o contiki-labels.s
111contiki-labels.s: contiki
112 ./make-labels
113
adamdunkels4b0459d2003-04-05 12:35:32 +0000114contiki: contiki-main.o strncasecmp.o petsciiconv.o \
115 ctk-conio.o ctk.o ek.o dispatcher.o \
adamdunkels37bb23d2003-04-08 20:10:07 +0000116 program-handler.o loader-arch.o
117 cl65 -Ln contiki-labels -C vic20.cfg -o contiki -t $(SYS) $^
118
adamdunkels4b0459d2003-04-05 12:35:32 +0000119
120clean:
adamdunkels37bb23d2003-04-08 20:10:07 +0000121 rm -f *.o *~ *core contiki *.s *.prg
adamdunkels4b0459d2003-04-05 12:35:32 +0000122
123depend:
124 gcc -MM -Iapps -Ictk -Iuip -Iconf \
125 -I$(CONTIKI)/lib -I$(CONTIKI)/ek \
126 -I$(CONTIKI)/ctk -I$(CONTIKI)/apps -I$(CONTIKI)/uip \
127 *.c */*.c $(CONTIKI)/*/*.c > Makefile.depend
128
adamdunkels37bb23d2003-04-08 20:10:07 +0000129include Makefile.depend
130
131codesize:
132 od65 --dump-segsize *.o | egrep '\.o|CODE'