LIB=plw.lib all: $(LIB) CC=sdcc AS=sdasz80 AR=sdar CFLAGS=-mz80 --Werror --fsigned-char --std-sdcc99 --opt-code-speed LDFLAGS=--no-std-crt0 --fomit-frame-pointer lib_SRCS=$(wildcard *.z80) lib_OBJS=$(patsubst %.z80,%.rel,$(lib_SRCS)) $(LIB): $(lib_OBJS) plw_player.rel $(AR) -rcD $(LIB) $(lib_OBJS) cp $(LIB) .. cp plw_player.rel ../ plw_player.rel: plw_player.c player/plw_player.h player/plw_player.h: make -C player %.rel: %.z80 $(AS) -o $< %.rel: %.c $(CC) $(CFLAGS) $(LDFLAGS) -c $< .PHONY: clean clean: make -C player clean rm -f *.bin *.rel *.lk *.noi *.map *.ihx *.sym *.lst *.zx7 player.asm $(LIB)