25 lines
480 B
Makefile
25 lines
480 B
Makefile
# Preproc options
|
|
# -MMD is used to generate .d files for header dependencies
|
|
CPPFLAGS = -MMD
|
|
# main compilation
|
|
CFLAGS ?= -Werror -Wall #$(pkg-config --cflags sdl)
|
|
#Linker flags
|
|
LDFLAGS =
|
|
#Linker path
|
|
LDLIBS = #$(pkg-config --libs sdl)
|
|
|
|
program = test
|
|
sources = $(wildcard *.c)
|
|
objects = $(sources:%.c=%.o)
|
|
depends = $(sources:%.c=%.d)
|
|
|
|
$(program): $(objects)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) $(program) $(objects) $(depends)
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
-include $(depends)
|
|
endif
|