# Compilador CC=sdcc #CFLAGS=-DDEBUG # Assembler AS=asx8051 ASFLAGS=-plosgff # Linker LD=aslink LDFLAGS=-cn # Shell SHELL=bash # Archivos cmodules=main dp8390 eth arp ip udp elp amodules=leds modules=$(cmodules) $(amodules) all: el.hex debug.h: types.h leds.h reg51.h: reg51sdcc.h netdev.h: types.h dp8390.h: types.h reg51.h netdev.h eth.h: types.h ip.h: types.h arp.h: types.h eth.h ip.h udp.h: types.h elp.h: types.h dp8390.asm: dp8390.c dp8390.h debug.h eth.h dp8390.rel: dp8390.asm eth.asm: eth.c eth.h netdev.h debug.h eth.rel: eth.asm arp.asm: arp.c arp.h netdev.h debug.h arp.rel: arp.asm ip.asm: ip.c ip.h netdev.h debug.h ip.rel: ip.asm udp.asm: udp.c udp.h ip.h netdev.h debug.h udp.rel: udp.asm elp.asm: elp.c elp.h leds.h udp.h netdev.h debug.h elp.rel: elp.asm main.asm: main.c leds.h reg51.h netdev.h eth.h ip.h udp.h elp.h debug.h main.rel: main.asm leds.rel: leds.asm el.hex: $(addsuffix .rel, $(modules)) @echo -e \ "-myuxi\n"\ "-Y\n"\ "-b CSEG = 0x0000\n"\ "-b ISEG = 0x0080\n"\ "-b BSEG = 0x0000\n"\ "-k /usr/share/sdcc/lib/small\n"\ "-k /usr/share/sdcc/lib/small\n"\ "-l mcs51\n"\ "-l libsdcc\n"\ "-l libint\n"\ "-l liblong\n"\ "-l libfloat\n"\ "$(addsuffix .rel\n, $(modules))"\ "-e\n" | \ $(LD) $(LDFLAGS) @packihx main.ihx > el.hex @$(RM) main.ihx %.asm: $(CC) $(CFLAGS) -c $< %.rel: $(AS) $(ASFLAGS) $< clean: @rm -vf el.hex *.rel $(addsuffix .asm, $(cmodules)) *.lst *.map *.lnk *.mem *.sym .PHONY: clean