sannyx | 912b45f | 2003-04-12 02:06:45 +0000 | [diff] [blame] | 1 | # 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 | # |
oliverschmidt | 1bcc93c | 2005-04-18 22:43:22 +0000 | [diff] [blame] | 34 | # $Id: Makefile,v 1.3 2005/04/18 22:43:22 oliverschmidt Exp $ |
sannyx | 912b45f | 2003-04-12 02:06:45 +0000 | [diff] [blame] | 35 | # |
| 36 | |
| 37 | all: contiki.com |
| 38 | |
| 39 | CONTIKI=../contiki |
| 40 | SYS=atari |
| 41 | |
oliverschmidt | 1bcc93c | 2005-04-18 22:43:22 +0000 | [diff] [blame] | 42 | include $(CONTIKI)/Makefile.common |
| 43 | |
sannyx | 912b45f | 2003-04-12 02:06:45 +0000 | [diff] [blame] | 44 | CC=cc65 |
| 45 | AS=ca65 |
| 46 | CFLAGS=-I ctk -I loader -I uip -I conf -I lib \ |
| 47 | -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \ |
| 48 | -I $(CONTIKI)/lib -I $(CONTIKI)/uip \ |
| 49 | -t $(SYS) --add-source -DWITH_ASCII \ |
| 50 | -DCTK_CONIO -DWITH_CC65 -DWITH_UIP -DWITH_RS232 -DWITH_WWW # -DWITH_TELNET |
| 51 | OPT=-Or |
| 52 | |
| 53 | %.o: %.c |
| 54 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 55 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 56 | |
| 57 | %.o: apps/%.c |
| 58 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 59 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 60 | |
| 61 | %.o: ctk/%.c |
| 62 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 63 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 64 | |
| 65 | %.o: lib/%.c |
| 66 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 67 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 68 | |
| 69 | %.o: loader/%.c |
| 70 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 71 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 72 | |
| 73 | %.o: uip/%.c |
| 74 | $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 75 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 76 | |
| 77 | %.o: $(CONTIKI)/apps/%.c |
| 78 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 79 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 80 | |
| 81 | %.o: $(CONTIKI)/ctk/%.c |
| 82 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 83 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 84 | |
| 85 | %.o: $(CONTIKI)/ek/%.c |
| 86 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 87 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 88 | |
| 89 | %.o: $(CONTIKI)/lib/%.c |
| 90 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 91 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 92 | |
| 93 | %.o: $(CONTIKI)/uip/%.c |
| 94 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 95 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 96 | |
| 97 | |
| 98 | %.o: ctk/%.S |
| 99 | $(AS) -o $@ $(AFLAGS) $< |
| 100 | |
| 101 | %.o: loader/%.S |
| 102 | $(AS) -o $@ $(AFLAGS) $< |
| 103 | |
sannyx | 912b45f | 2003-04-12 02:06:45 +0000 | [diff] [blame] | 104 | contiki.com: contiki-main.o strncasecmp.o petsciiconv.o \ |
| 105 | ctk-conio.o ctk.o ek.o dispatcher.o \ |
| 106 | program-handler.o $(WWW) $(UIP) rs232dev.o \ |
| 107 | about.o netconf.o processes.o |
| 108 | cl65 -C atari.cfg -Ln contiki-labels -o $@ -t $(SYS) $^ |
| 109 | @if [ ! -f Makefile.depend ]; then \ |
| 110 | echo ; \ |
| 111 | echo "*** warning: you didn't make depend, result may be unaccurate!"; \ |
| 112 | echo ; \ |
| 113 | fi |
| 114 | |
| 115 | clean: |
| 116 | rm -f *.o *~ *core contiki *.s *.prg contiki-labels contiki.com Makefile.depend |
| 117 | |
| 118 | depend: |
sannyx | 6f0c75c | 2003-04-14 21:31:28 +0000 | [diff] [blame] | 119 | gcc -MM -MG -Iapps -Ictk -Iuip -Iconf -Ilib -I$(CC65_INC) \ |
sannyx | 912b45f | 2003-04-12 02:06:45 +0000 | [diff] [blame] | 120 | -I$(CONTIKI)/lib -I$(CONTIKI)/ek \ |
| 121 | -I$(CONTIKI)/ctk -I$(CONTIKI)/apps -I$(CONTIKI)/uip \ |
| 122 | *.c */*.c $(CONTIKI)/*/*.c > Makefile.depend |
| 123 | |
| 124 | -include Makefile.depend |
| 125 | |
| 126 | codesize: |
| 127 | od65 --dump-segsize *.o | egrep '\.o|CODE' |