-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
29 lines (19 loc) · 837 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CFLAGS=-Wall -Wextra -pedantic -O2 -Iinclude
LIBS=-lm -lcurses -lSDL2 -pthread
TARGET=jogo
SRC = src
SDL := $(shell dpkg -s libsdl2-dev && echo "SDL installed" || sudo apt-get -y install libsdl2-dev && echo "SDL installed")
SOURCES = $(wildcard src/engine/render/*.c) $(wildcard src/engine/ui/*.c) $(wildcard src/engine/utils/*.c) $(wildcard src/game/*.c) $(wildcard src/game/debug/*.c) $(wildcard src/game/inventory/*.c) $(wildcard src/game/map/*.c) $(wildcard src/game/player/*.c) $(wildcard src/game/ui/*.c) $(wildcard src/game/ai/*.c)
OBJECTS = $(patsubst $(SRC)/%.c, $(SRC)/%.o, $(SOURCES))
all: compile clean
compile: $(OBJECTS)
-rm -f $(TARGET)
$(CC) -o $(TARGET) $^ $(LIBS)
$(SRC)/%.o: $(SRC)/%.c
$(CC) -o $@ -c $< $(CFLAGS)
run:
make compile
./$(TARGET)
clean:
-rm -f $(OBJECTS)
.PHONY : all compile clean run