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