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