Imported Upstream version 2.9.0
[debian/cc1111] / device / examples / Makefile
1
2 #DO_GCC=1
3 DO_Z80=1
4 #DO_MCS51=1
5
6 ifdef DO_GCC
7 CC = gcc -Wall -g
8 endif
9
10 ifdef DO_Z80
11 OBJEXT=o
12 CC = sdcc
13 MFLAGS = --debug -mz80
14 endif
15
16 ifdef DO_MCS51
17 OBJEXT=rel
18 CC = sdcc
19 MFLAGS = --debug --model-small --stack-after-data
20 #CFLAGS = -V
21 #MFLAGS = --debug --model-large --stack-after-data
22 #LFLAGS = --xram-loc 0x4000 --code-loc 0x0000
23 endif
24
25
26 #OBJECTS = test3.c itoa.$(OBJEXT) crc.$(OBJEXT)
27 OBJECTS = test3.c itoa.$(OBJEXT)
28
29 all: test3.ihx
30
31 ifdef DO_MCS51
32 an429.ihx : an429.c
33         sdcc --model-small an429.c
34
35 test2.ihx : test2.c
36         sdcc --model-small test2.c
37 endif
38
39 %.$(OBJEXT): %.c
40         $(CC) -c $(CFLAGS) $(MFLAGS) $<
41
42 itoa.rel : itoa.c
43         $(CC) -c $(CFLAGS) $(MFLAGS) itoa.c
44
45 #crc.rel : crc.c
46 #       $(CC) -c $(CFLAGS) $(MFLAGS) crc.c
47
48 test3.ihx: $(OBJECTS)
49         $(CC) $(MFLAGS) $(LFLAGS) $(OBJECTS)
50
51 test3.bin: test3.ihx
52         makebin < test3.ihx > test3.bin
53
54 clean:
55         rm -f core *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.o \
56                 *.rst *.sym *.lnk *.lib *.bin
57
58 testser: test3.ihx
59         s51 -Sout=serial.log test3.ihx
60