Clean up autotools stuff.
[fw/altos] / target / blink / 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=-L/usr/share/sdcc/lib/large --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=blink.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=blink-flash.ihx blink-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 blink-ram.ihx: $(REL) Makefile
37         $(CC) $(LDFLAGS_RAM) $(CFLAGS) -o blink-ram.ihx $(REL)
38         $(CC) $(LDFLAGS_FLASH) $(CFLAGS) -o blink-flash.ihx $(REL)
39
40 blink-flash.ihx: blink-ram.ihx
41
42 clean:
43         rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
44         rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)