]> git.llucax.com Git - z.facultad/66.09/etherled.git/blob - src/Makefile
Faltó reemplazar un petherled por EPL =)
[z.facultad/66.09/etherled.git] / src / Makefile
1
2 # Compilador
3 CC=sdcc
4 CFLAGS=-DDEBUG
5
6 # Assembler
7 AS=asx8051
8 ASFLAGS=-plosgff
9
10 # Linker
11 LD=aslink
12 LDFLAGS=-cn
13
14 # Shell
15 SHELL=bash
16
17 # Archivos
18 cmodules=main dp8390 eth ip udp
19 amodules=leds
20 modules=$(cmodules) $(amodules)
21
22 all: el.hex
23
24 debug.h: types.h leds.h
25
26 reg51.h: reg51sdcc.h
27
28 netdev.h: types.h
29
30 dp8390.h: types.h reg51.h netdev.h
31
32 eth.h: types.h
33
34 ip.h: types.h
35
36 udp.h: types.h
37
38 dp8390.asm: dp8390.c dp8390.h debug.h eth.h
39 dp8390.rel: dp8390.asm
40
41 eth.asm: eth.c eth.h netdev.h debug.h
42 eth.rel: eth.asm
43
44 ip.asm: ip.c ip.h netdev.h debug.h
45 ip.rel: ip.asm
46
47 udp.asm: udp.c udp.h ip.h netdev.h debug.h
48 udp.rel: udp.asm
49
50 main.asm: main.c leds.h reg51.h netdev.h eth.h ip.h udp.h debug.h
51 main.rel: main.asm
52
53 leds.rel: leds.asm
54
55 el.hex: $(addsuffix .rel, $(modules))
56         @echo -e \
57                         "-myuxi\n"\
58                         "-Y\n"\
59                         "-b CSEG = 0x0000\n"\
60                         "-b ISEG = 0x0080\n"\
61                         "-b BSEG = 0x0000\n"\
62                         "-k /usr/share/sdcc/lib/small\n"\
63                         "-k /usr/share/sdcc/lib/small\n"\
64                         "-l mcs51\n"\
65                         "-l libsdcc\n"\
66                         "-l libint\n"\
67                         "-l liblong\n"\
68                         "-l libfloat\n"\
69                         "$(addsuffix .rel\n, $(modules))"\
70                         "-e\n" | \
71                 $(LD) $(LDFLAGS)
72         @packihx main.ihx > el.hex
73         @$(RM) main.ihx
74
75 %.asm:
76         $(CC) $(CFLAGS) -c $<
77
78 %.rel:
79         $(AS) $(ASFLAGS) $<
80
81
82 clean:
83         @rm -vf el.hex *.rel $(addsuffix .asm, $(cmodules)) *.lst *.map *.lnk *.mem *.sym
84
85 .PHONY: clean