adamdunkels | d9ae56d | 2003-04-11 20:29:28 +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. |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 12 | # 3. The name of the author may not be used to endorse or promote |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 13 | # 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 | # |
oliverschmidt | e4e7e53 | 2005-04-27 23:50:23 +0000 | [diff] [blame] | 30 | # $Id: Makefile,v 1.3 2005/04/27 23:50:23 oliverschmidt Exp $ |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 31 | # |
| 32 | |
| 33 | all: contiki loader-arch-module.o contiki-labels.o \ |
| 34 | about.prg processes.prg netconf.prg memstat.prg calc.prg |
| 35 | |
| 36 | CONTIKI=../contiki |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 37 | CONTIKICC65=../contiki-cc65 |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 38 | SYS=pet |
| 39 | |
| 40 | CC=cc65 |
| 41 | AS=ca65 |
| 42 | CFLAGS=-I apps -I ctk -I loader -I uip -I conf \ |
| 43 | -I $(CONTIKI)/apps -I $(CONTIKI)/ctk -I $(CONTIKI)/ek \ |
| 44 | -I $(CONTIKI)/lib -I $(CONTIKI)/uip \ |
| 45 | -t $(SYS) --add-source -DWITH_LOADER_ARCH |
| 46 | OPT=-Or |
| 47 | |
| 48 | %.o: %.c |
| 49 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 50 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 51 | |
| 52 | %.o: apps/%.c |
| 53 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 54 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 55 | |
| 56 | %.o: ctk/%.c |
| 57 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 58 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 59 | |
| 60 | %.o: loader/%.c |
| 61 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 62 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 63 | |
| 64 | %.o: uip/%.c |
| 65 | $(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 66 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 67 | |
| 68 | %.o: $(CONTIKI)/apps/%.c |
| 69 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 70 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 71 | |
| 72 | %.o: $(CONTIKI)/ctk/%.c |
| 73 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 74 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 75 | |
| 76 | %.o: $(CONTIKI)/ek/%.c |
| 77 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 78 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 79 | |
| 80 | %.o: $(CONTIKI)/lib/%.c |
| 81 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 82 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 83 | |
| 84 | %.o: $(CONTIKI)/uip/%.c |
| 85 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 86 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 87 | |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 88 | %.o: $(CONTIKICC65)/apps/%.c |
| 89 | $(CC) $(CFLAGS) $(OPT) -o $(patsubst %c, %s, $(notdir $<)) $< |
| 90 | $(AS) -o $@ $(AFLAGS) $(*).s |
| 91 | |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 92 | |
| 93 | %.o: apps/%.S |
| 94 | $(AS) -o $@ $(AFLAGS) $< |
| 95 | |
| 96 | %.o: ctk/%.S |
| 97 | $(AS) -o $@ $(AFLAGS) $< |
| 98 | |
| 99 | %.o: loader/%.S |
| 100 | $(AS) -o $@ $(AFLAGS) $< |
| 101 | |
| 102 | %.prg: %.o contiki-labels.o |
| 103 | cl65 --module -t $(SYS) -o $@ loader-arch-module.o $^ |
| 104 | |
| 105 | |
| 106 | contiki-labels.o: contiki-labels.s |
| 107 | ca65 -o contiki-labels.o contiki-labels.s |
| 108 | contiki-labels.s: contiki |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 109 | $(CONTIKICC65)/make-labels |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 110 | |
| 111 | contiki: contiki-main.o strncasecmp.o petsciiconv.o \ |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 112 | ctk-conio.o ctk.o ek.o timer.o arg.o \ |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 113 | program-handler.o loader-arch.o |
| 114 | cl65 -Ln contiki-labels -o contiki -t $(SYS) $^ |
| 115 | |
| 116 | |
| 117 | clean: |
| 118 | rm -f *.o *~ *core contiki *.s *.prg |
| 119 | |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 120 | codesize: |
| 121 | od65 --dump-segsize *.o | egrep '\.o|CODE' |