-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (46 loc) · 1.47 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# compile stuff in this dir
CC = gcc
GLADE2C = ./tools/glade2c
CFLAGS += -Iinclude
CFLAGS += -I/usr/X11R6/include `pkg-config --cflags gtk+-3.0`
CFLAGS += -g -O2
CFLAGS += -fPIE
CFLAGS += -Wl,--export-dynamic
CFLAGS += -DGSEAL_ENABLE
CLFLAS += -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
CFLAGS += -DGTK_DISABLE_SINGLE_INCLUDES
CFLAGS += -DGDK_PIXBUF_DISABLE_DEPRECATED
CFLAGS += -DG_DISABLE_DEPRECATED
CFLAGS += -Wall -Wextra -Werror
CFLAGS += -fstack-protector-strong -Wformat -Werror=format-security
CFLAGS += -D_FORTIFY_SOURCE=2
DFLAGS = -L/usr/X11R6/lib
DFLAGS += `pkg-config --libs gtk+-3.0`
DFLAGS += `pkg-config --libs gmodule-2.0`
DFLAGS += -Wall -Wextra
DFLAGS += -fPIE
DFLAGS += -Wl,-z,relro "-Wl,--as-needed"
LIBS = -lm
SRC_FILES := $(wildcard src/*.c)
HDR_FILES := $(wildcard include/*.h)
OBJ_FILES := $(subst .c,.o,$(subst src/,obj/,$(SRC_FILES)))
DB_OBJS = obj/make_db.o obj/read_db.o
PIX_OBJS = $(filter-out obj/make_db.o,$(OBJ_FILES))
all: obj make_db pixelize
make_db: $(DB_OBJS)
$(CC) -o $@ $(DB_OBJS) $(DFLAGS) $(LIBS)
pixelize: $(PIX_OBJS)
$(CC) -o $@ $(PIX_OBJS) $(DFLAGS) $(LIBS)
obj/%.o: depend
obj/%.o: src/%.c
$(CC) -c -o $@ $(CFLAGS) $<
depend: Makefile $(HDR_FILES) $(SRC_FILES) include/pixelize_model.h
$(CC) -MM $(CFLAGS) $(SRC_FILES) > depend
include/pixelize_model.h: glade/pixelize.glade
$(GLADE2C) -i $< -o $@
clang-format -i $@
clean:
rm -rf $(OBJ_FILES) pixelize make_db core depend include/pixelize_model.h
obj:
mkdir $@
include depend