# target exe file EXE = epromemu.exe # source files SRC = epromemu.c RES = # libraries LIB = # build type - DEBUG or RELEASE BUILDTYPE = RELEASE ############################################################################### # object files OBJ = $(SRC:.c=.o) $(RES:.rc=.o) # setup CC=gcc CFLAGS=-Wall -pedantic -std=gnu99 LDFLAGS= RM=rm ifeq ($(BUILDTYPE), DEBUG) CFLAGS += -DDEBUG -g -ggdb else CFLAGS += -O3 LDFLAGS += --strip-all endif .PHONY: all clean %.o: %.c $(CC) $(CFLAGS) -o $@ -c $< %.o: %.rc windres -o $@ -i $< all: $(EXE) $(EXE): $(OBJ) $(CC) $(OBJ) $(LIB) $(LDFLAGS) -o $@ resource.rc: RESOURCE.RC mv RESOURCE.RC resource.rc clean: -$(RM) $(OBJ)