# Compilador CC=sdcc CFLAGS=-DDEBUG # Assembler AS=asx8051 ASFLAGS=-plosgff # Linker LD=aslink LDFLAGS=-cn # Shell SHELL=bash # Archivos cmodules=main dp8390 eth ip udp 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 udp.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 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 main.asm: main.c leds.h reg51.h netdev.h eth.h ip.h udp.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