adamdunkels | 42071e2 | 2003-04-08 18:08:24 +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 | # This file is part of the Contiki desktop environment |
| 32 | # |
| 33 | # $Id: Makefile,v 1.1 2003/04/08 18:08:24 adamdunkels Exp $ |
| 34 | # |
| 35 | |
| 36 | CONTIKI=../contiki |
| 37 | SYS=c128 |
| 38 | |
| 39 | CC=cc65 |
| 40 | AS=ca65 |
| 41 | CFLAGS=-I ctk -I uip -I conf \ |
| 42 | -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \ |
| 43 | -I $(CONTIKI)/lib -I $(CONTIKI)/uip \ |
| 44 | -t $(SYS) --add-source |
| 45 | OPT=-Or |
| 46 | |
| 47 | %.o: %.c |
| 48 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 49 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 50 | |
| 51 | %.o: ctk/%.c |
| 52 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 53 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 54 | |
| 55 | %.o: uip/%.c |
| 56 | $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 57 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 58 | |
| 59 | %.o: $(CONTIKI)/apps/%.c |
| 60 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 61 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 62 | |
| 63 | %.o: $(CONTIKI)/ctk/%.c |
| 64 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 65 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 66 | |
| 67 | %.o: $(CONTIKI)/ek/%.c |
| 68 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 69 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 70 | |
| 71 | %.o: $(CONTIKI)/lib/%.c |
| 72 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 73 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 74 | |
| 75 | %.o: $(CONTIKI)/uip/%.c |
| 76 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 77 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 78 | |
| 79 | |
| 80 | %.o: ctk/%.S |
| 81 | $(AS) -o $@ $(AFLAGS) $< |
| 82 | |
| 83 | |
| 84 | UIP=uip.o uip_arch.o uip_main.o resolv.o |
| 85 | |
| 86 | WWW=www.o webclient.o http-strings.o htmlparser.o html-strings.o |
| 87 | EMAIL=email.o smtp.o smtp-strings.o |
| 88 | WEBSERVER=webserver.o http-strings.o |
| 89 | TELNET=simpletelnet.o telnet.o |
| 90 | |
| 91 | contiki: contiki-main.o strncasecmp.o petsciiconv.o \ |
| 92 | ctk-conio.o ctk.o ek.o dispatcher.o \ |
| 93 | program-handler.o about.o processes.o netconf.o |
| 94 | cl65 -o contiki -t $(SYS) $^ |
| 95 | |
| 96 | clean: |
| 97 | rm -f *.o *~ *core contiki *.s |
| 98 | |
| 99 | depend: |
| 100 | gcc -MM -Iapps -Ictk -Iuip -Iconf \ |
| 101 | -I$(CONTIKI)/lib -I$(CONTIKI)/ek \ |
| 102 | -I$(CONTIKI)/ctk -I$(CONTIKI)/apps -I$(CONTIKI)/uip \ |
| 103 | *.c */*.c $(CONTIKI)/*/*.c > Makefile.depend |
| 104 | |
| 105 | include Makefile.depend |
| 106 | |
| 107 | codesize: |
| 108 | od65 --dump-segsize *.o | egrep '\.o|CODE' |