12 CA65_INC := $(abspath ../asminc)
13 CC65_INC := $(abspath ../include)
14 LD65_LIB := $(abspath ../lib)
15 LD65_OBJ := $(abspath ../lib)
16 LD65_CFG := $(abspath ../cfg)
18 CFLAGS += -MMD -MP -O -std=c89 -I common \
19 -Wall -Wextra -Wno-char-subscripts -Werror \
20 -DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
21 -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
34 $(foreach prog,$(PROGS),$(INSTALL_recipe))
37 $(foreach prog,$(PROGS),$(UNINSTALL_recipe))
39 .PHONY: all $(PROGS) mostlyclean clean install uninstall
47 ln -s $(abspath ../bin/$(prog)) /usr/local/bin/$(prog)
53 define UNINSTALL_recipe
55 $(RM) /usr/local/bin/$(prog)
63 $1_OBJS := $$(patsubst %.c,../wrk/%.o,$$(wildcard $1/*.c))
65 $$($1_OBJS): | ../wrk/$1
70 DEPS += $$($1_OBJS:.o=.d)
78 $$(eval $$(call OBJS_template,$1))
80 ../bin/$1: $$($1_OBJS) ../wrk/common/common.a | ../bin
81 $$(CC) $$(LDFLAGS) -o $$@ $$^ $$(LDLIBS)
91 @$(CC) -c $(CFLAGS) -o $@ $<
96 $(eval $(call OBJS_template,common))
97 ../wrk/common/common.a: $(common_OBJS)
100 $(foreach prog,$(PROGS),$(eval $(call PROG_template,$(prog))))