BIN := ../game.exe CC := i586-pc-msdosdjgpp-gcc CFLAGS := -I. -c -Wall -pedantic -O2 -march=i386 LDFLAGS := -s IMGS := $(wildcard ../data/*.png) IMG_OBJS := $(IMGS:../data/%.png=%.o) MAPS := ../data/stage.json MAP_OBJS := $(MAPS:../data/%.json=%.o) SRCS := $(wildcard *.c) OBJS := $(SRCS:.c=.o) $(IMG_OBJS) palette.o $(MAP_OBJS) all: $(BIN) $(BIN): $(OBJS) $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ .c.o: $(CC) $(CFLAGS) $< -o $@ palette.o: ../data/sprites.png ../tools/pngpal.py $< $@ $(IMG_OBJS): %.o: ../data/%.png ../tools/pngpix.py $< $@ $(MAP_OBJS): %.o: ../data/%.json ../tools/map.py $< $@ clean: rm -f $(BIN) *.o Makefile.deps Makefile.deps: $(SRCS) $(CC) $(CFLAGS) -MM *.[ch] > Makefile.deps .PHONY: all clean include Makefile.deps