-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (30 loc) · 870 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
32
33
34
35
36
37
CFLAGS=`pkg-config --cflags gtk4 libcurl`
LIBS=`pkg-config --libs gtk4 libcurl`
SINGLE_LIBS=-llexbor_static
SP_OUTPUT_DIR=build
SP_OUTPUT_NAME=seekpeek
SP_OUTPUT_LOCATION=$(SP_OUTPUT_DIR)/$(SP_OUTPUT_NAME)
SOURCES=$(shell find . -name '*.c')
DEBUG_FLAGS=-g3
run:
./$(SP_OUTPUT_LOCATION)
SOURCES=$(wildcard *.c)
%.o: %.c
gcc -c $(CFLAGS) -o $(SP_OUTPUT_DIR)/$(notdir $@) $^ $(LIBS) $(SINGLE_LIBS)
# gcc $(CFLAGS) main.c -o $(SP_OUTPUT_LOCATION) $(LIBS) $(SINGLE_LIBS)
build:
mkdir $(SP_OUTPUT_DIR)
gcc $(CFLAGS) -o $(SP_OUTPUT_LOCATION) $(shell find . -name '*.c') $(LIBS) $(SINGLE_LIBS)
debug_build:
mkdir $(SP_OUTPUT_DIR)
gcc $(CFLAGS) $(DEBUG_FLAGS) -o $(SP_OUTPUT_LOCATION) $(shell find . -name '*.c') $(LIBS) $(SINGLE_LIBS)
clean:
rm -rf $(SP_OUTPUT_DIR)/
all:
make clean
make build
make run
debug:
make clean
make debug_build
make run