Rename tools to ao-<foo>
[fw/altos] / ao-tools / target / ee / 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 0xf800 --xram-size 1024
12
13 LDFLAGS_FLASH=$(LDFLAGS) --code-loc 0x0000 --xram-loc 0xf000 --xram-size 1024
14
15 SRC=ee.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=ee-flash.ihx ee-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 ee-ram.ihx: $(REL) Makefile
37         $(CC) $(LDFLAGS_RAM) $(CFLAGS) -o ee-ram.ihx $(REL)
38         $(CC) $(LDFLAGS_FLASH) $(CFLAGS) -o ee-flash.ihx $(REL)
39
40 ee-flash.ihx: ee-ram.ihx
41
42 clean:
43         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
44         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
45
46 install: