@@ -9,22 +9,22 @@ SDIR=src
99LDIR =lib
1010
1111CPPFLAGS += -D_POSIX_C_SOURCE=200809L -DNOTIFICATIONS -I$(IDIR )
12- LDLIBS += -ffunction-sections -fdata-sections -Wl,--gc-sections \
13- -lcurl -lmecab -pthread $( shell pkg-config --libs gtk+-3.0) $( shell pkg-config --libs libnotify) -llmdb
12+ LDLIBS +=-lcurl -lmecab -pthread $( shell pkg-config --libs gtk+-3.0) $( shell pkg-config --libs libnotify) -llmdb
13+ # LDLIBS+=-ffunction-sections -fdata-sections -Wl,--gc-sections
1414
1515O_HAVEX11 := 1 # X11 integration
1616ifeq ($(strip $(O_HAVEX11 ) ) ,1)
1717 CPPFLAGS += -DHAVEX11
1818 LDLIBS += -lXfixes -lX11
1919endif
2020
21- CFLAGS := -Werror $(shell pkg-config --cflags gtk+-3.0) $(shell pkg-config --cflags libnotify) $( CFLAGS )
21+ CFLAGS := -Werror $(shell pkg-config --cflags gtk+-3.0) $(shell pkg-config --cflags libnotify)
2222DEBUG_CFLAGS =-DDEBUG \
2323 -Wall -Wextra -Wpedantic -Wstrict-prototypes -Wdouble-promotion -Wshadow \
2424 -Wno-unused-parameter -Wno-sign-conversion -Wno-unused-function -Wpointer-arith \
2525 -Wmissing-prototypes -Wstrict-prototypes -Wstrict-overflow -Wcast-align \
2626 -fsanitize=leak,address,undefined -fsanitize-undefined-trap-on-error -fstack-protector-strong \
27- -Og -ggdb
27+ -O0 -ggdb
2828RELEASE_CFLAGS =-O3 -flto -march=native -Wmaybe-uninitialized
2929
3030FILES =dictpopup.c util.c platformdep.c deinflector.c settings.c db.c ankiconnectc.c database.c jppron.c pdjson.c
@@ -33,12 +33,11 @@ SRC=$(addprefix $(SDIR)/,$(FILES))
3333SRC_H =$(addprefix $(IDIR ) /,$(FILES_H ) )
3434
3535
36- CFLAGS_CREATE =-I$(IDIR ) -isystem$(LIBDIR ) /lmdb/libraries/liblmdb -D_POSIX_C_SOURCE=200809L $(shell pkg-config --cflags glib-2.0)
37- LDLIBS_CREATE =-ffunction-sections -fdata-sections -Wl,--gc-sections \
38- -lzip $(shell pkg-config --libs glib-2.0) -llmdb
36+ CFLAGS_CREATE =-I$(IDIR ) -D_POSIX_C_SOURCE=200809L $(shell pkg-config --cflags glib-2.0)
37+ LDLIBS_CREATE =-lzip $(shell pkg-config --libs glib-2.0) -llmdb
3938
40- FILES_CREATE =db.c pdjson.c util.c settings.c
41- FILES_H_CREATE =db.h pdjson.h util.h buf.h settings.h
39+ FILES_CREATE =db.c pdjson.c util.c
40+ FILES_H_CREATE =db.h pdjson.h util.h buf.h
4241
4342SRC_CREATE =$(addprefix $(SDIR ) /,$(FILES_CREATE ) ) $(LMDB_FILES )
4443SRC_H_CREATE =$(addprefix $(IDIR ) /,$(FILES_H_CREATE ) )
@@ -57,6 +56,11 @@ dictpopup: $(SRC) $(SRC_H)
5756dictpopup-create : $(SRC_CREATE ) $(SRC_H_CREATE )
5857 $(CC ) $(CFLAGS_CREATE ) -o $@ $(SDIR ) /dictpopup_create.c $(SRC_CREATE ) $(LDLIBS_CREATE )
5958
59+ cli : $(SRC ) $(SRC_H )
60+ $(CC ) $(CFLAGS ) $(DEBUG_CFLAGS ) $(CPPFLAGS ) -o $@ $(SDIR ) /cli.c $(SRC ) $(LDLIBS )
61+ deinflector : $(SRC ) $(SRC_H )
62+ $(CC ) $(CFLAGS ) $(DEBUG_CFLAGS ) -I$(IDIR ) -DDEINFLECTOR_MAIN -o $@ $(SDIR ) /deinflector.c $(SDIR ) /util.c $(LDLIBS )
63+
6064release :
6165 version=$$(git describe ) ; prefix=dictpopup-$$ {version#v}; \
6266 git archive --prefix=$$ prefix/ HEAD | gzip -9 > $$ prefix.tar.gz
@@ -86,7 +90,7 @@ uninstall:
8690 $(CONFIG_DIR ) /config.ini
8791
8892clean :
89- rm -f dictpopup dictpopup-create tests
93+ rm -f dictpopup dictpopup-create tests cli deinflector
9094
9195tests : $(SRC ) $(SRC_H )
9296 $(CC ) $(CFLAGS ) $(DEBUG_CFLAGS ) $(CPPFLAGS ) -o $@ $(SDIR ) /tests.c $(SRC ) $(LDLIBS )
0 commit comments