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