-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
31 lines (21 loc) · 841 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
30
31
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
CC = gcc
CFLAGS = -O3 -g -Wall
INCLUDES = -I/usr/include/glib-2.0 -Iinclude
LIBS = -lm -lpthread -lglib-2.0 -lncursesw
PKG_CONFIG = `pkg-config --cflags --libs glib-2.0`
HEADERS = $(call rwildcard,include,*.h)
SRC = $(call rwildcard,src,*.c)
OBJS = ${SRC:src/%.c=obj/%.o}
.PHONY: default
default: guiao-3
.PHONY: clean
clean:
rm -f ${OBJS} core *.core guiao-3 test saida/*.indx saida/*.dat saida/*.tmp saida/*.txt
obj/%.o: src/%.c ${HEADERS}
mkdir -p $(dir $@)
${CC} ${CFLAGS} -c -o $@ ${INCLUDES} ${PKG_CONFIG} $< ${LIBS}
guiao-3: $(filter-out obj/tests/tests.o,$(OBJS))
${CC} ${CFLAGS} -o $@ ${INCLUDES} ${PKG_CONFIG} $^ ${LIBS}
test: $(filter-out obj/main.o,$(OBJS))
${CC} ${CFLAGS} -o $@ ${INCLUDES} ${PKG_CONFIG} $^ ${LIBS}