Rename tools to ao-<foo>
[fw/altos] / ao-tools / target / radio / Makefile
1 CC=sdcc
2 NO_OPT=--nogcse --noinvariant --noinduction --nojtbound --noloopreverse \
3         --nolabelopt --nooverlay --peep-asm
4 DEBUG=--debug
5
6 CFLAGS=--model-large $(DEBUG) --less-pedantic \
7         --no-peep --int-long-reent --float-reent \
8         --data-loc 0x30
9
10 LDFLAGS=--out-fmt-ihx
11 LDFLAGS_RAM=$(LDFLAGS) --code-loc 0xf000 --xram-loc 0xf400 --xram-size 1024
12
13 LDFLAGS_FLASH=$(LDFLAGS) --code-loc 0x0000 --xram-loc 0xf000 --xram-size 1024
14
15 SRC=xmit.c recv.c init.c
16 ADB=$(SRC:.c=.adb)
17 ASM=$(SRC:.c=.asm)
18 LNK=$(SRC:.c=.lnk)
19 LST=$(SRC:.c=.lst)
20 REL=$(SRC:.c=.rel)
21 RST=$(SRC:.c=.rst)
22 SYM=$(SRC:.c=.sym)
23
24 PROGS=xmit-flash.ihx xmit-ram.ihx recv-flash.ihx recv-ram.ihx
25 PCDB=$(PROGS:.ihx=.cdb)
26 PLNK=$(PROGS:.ihx=.lnk)
27 PMAP=$(PROGS:.ihx=.map)
28 PMEM=$(PROGS:.ihx=.mem)
29 PAOM=$(PROGS:.ihx=)
30
31 %.rel : %.c
32         $(CC) -c $(CFLAGS) -o$*.rel $<
33
34 all: $(PROGS)
35
36 xmit-ram.ihx: xmit.rel init.rel Makefile
37         $(CC) $(LDFLAGS_RAM) $(CFLAGS) -o xmit-ram.ihx xmit.rel init.rel
38         $(CC) $(LDFLAGS_FLASH) $(CFLAGS) -o xmit-flash.ihx xmit.rel init.rel
39
40 xmit-flash.ihx: xmit-ram.ihx
41
42 recv-ram.ihx: recv.rel init.rel Makefile
43         $(CC) $(LDFLAGS_RAM) $(CFLAGS) -o recv-ram.ihx recv.rel init.rel
44         $(CC) $(LDFLAGS_FLASH) $(CFLAGS) -o recv-flash.ihx recv.rel init.rel
45
46 recv-flash.ihx: recv-ram.ihx
47
48 clean:
49         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
50         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
51
52 install: