]> git.llucax.com Git - z.facultad/66.09/etherled.git/blob - src/Makefile
Implementa el protocolo ELP sobre UDP. Tiene problemas cuando los leds estan
[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 elp
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 elp.h: types.h
39
40 dp8390.asm: dp8390.c dp8390.h debug.h eth.h
41 dp8390.rel: dp8390.asm
42
43 eth.asm: eth.c eth.h netdev.h debug.h
44 eth.rel: eth.asm
45
46 ip.asm: ip.c ip.h netdev.h debug.h
47 ip.rel: ip.asm
48
49 udp.asm: udp.c udp.h ip.h netdev.h debug.h
50 udp.rel: udp.asm
51
52 elp.asm: elp.c elp.h leds.h udp.h netdev.h debug.h
53 elp.rel: elp.asm
54
55 main.asm: main.c leds.h reg51.h netdev.h eth.h ip.h udp.h elp.h debug.h
56 main.rel: main.asm
57
58 leds.rel: leds.asm
59
60 el.hex: $(addsuffix .rel, $(modules))
61         @echo -e \
62                         "-myuxi\n"\
63                         "-Y\n"\
64                         "-b CSEG = 0x0000\n"\
65                         "-b ISEG = 0x0080\n"\
66                         "-b BSEG = 0x0000\n"\
67                         "-k /usr/share/sdcc/lib/small\n"\
68                         "-k /usr/share/sdcc/lib/small\n"\
69                         "-l mcs51\n"\
70                         "-l libsdcc\n"\
71                         "-l libint\n"\
72                         "-l liblong\n"\
73                         "-l libfloat\n"\
74                         "$(addsuffix .rel\n, $(modules))"\
75                         "-e\n" | \
76                 $(LD) $(LDFLAGS)
77         @packihx main.ihx > el.hex
78         @$(RM) main.ihx
79
80 %.asm:
81         $(CC) $(CFLAGS) -c $<
82
83 %.rel:
84         $(AS) $(ASFLAGS) $<
85
86
87 clean:
88         @rm -vf el.hex *.rel $(addsuffix .asm, $(cmodules)) *.lst *.map *.lnk *.mem *.sym
89
90 .PHONY: clean