34 lines
565 B
Makefile
34 lines
565 B
Makefile
|
.PHONY: all debug release clean
|
||
|
|
||
|
CFLAGS := -std=gnu17 -pedantic -Wall -Wextra ${CFLAGS}
|
||
|
LDLIBS :=
|
||
|
|
||
|
sources := source/engine.c \
|
||
|
source/game.c \
|
||
|
source/main.c \
|
||
|
source/menu.c \
|
||
|
source/render.c \
|
||
|
source/source.c \
|
||
|
source/system.c
|
||
|
|
||
|
obj = ${sources:.c=.o}
|
||
|
dep = ${sources:.c=.d}
|
||
|
|
||
|
.c.o:
|
||
|
$(CC) -MD -MP $(CFLAGS) -c $< -o $@
|
||
|
|
||
|
all: debug
|
||
|
|
||
|
debug: CFLAGS += -g
|
||
|
release: CFLAGS += -O3
|
||
|
|
||
|
debug release: umorna
|
||
|
|
||
|
umorna: $(obj)
|
||
|
$(CC) $(LDLIBS) $< -o $@
|
||
|
|
||
|
clean:
|
||
|
rm -f umorna ${obj} ${dep}
|
||
|
|
||
|
-include ${dep}
|