-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
69 lines (48 loc) · 1.37 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
60
61
62
63
64
65
66
67
68
69
# enable/disable debug mode
DEBUG ?= 0
ifeq ($(DEBUG), 1)
CXXFLAGS += -DDEBUG=1
else
CXXFLAGS += -DDEBUG=0
endif
# set standard values, if not set by default
CXX ?= g++
CXXFLAGS += -O3 -Wall
# project-specific flags
EXTRA_CXXFLAGS += $(shell gimptool-2.0 --cflags && pkg-config --cflags lensfun exiv2)
LDFLAGS += $(shell gimptool-2.0 --libs && pkg-config --libs lensfun exiv2) -lstdc++
# set some system dependent options
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring mingw, $(SYS)))
ifeq ($(DEBUG), 0)
LDFLAGS += -Wl,-subsystem,windows
endif
else
# comment to disable OpenMP
CXXFLAGS += -fopenmp
LDFLAGS += -fopenmp
endif
# project data
PLUGIN = gimp-lensfun
SOURCES = src/gimplensfun.cpp
HEADERS = src/LUT.hpp
# END CONFIG ##################################################################
.PHONY: all install userinstall clean uninstall useruninstall
all: $(PLUGIN)
OBJECTS = $(subst .cpp,.o,$(SOURCES))
$(PLUGIN): $(OBJECTS)
$(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) $(EXTRA_CXXFLAGS) -c -o $@ $*.cpp
install: $(PLUGIN)
@gimptool-2.0 --install-admin-bin $^
userinstall: $(PLUGIN)
@gimptool-2.0 --install-bin $^
uninstall:
@gimptool-2.0 --uninstall-admin-bin $(PLUGIN)
useruninstall:
@gimptool-2.0 --uninstall-bin $(PLUGIN)
clean:
rm -f src/*.o $(PLUGIN)
debug:
$(MAKE) $(MAKEFILE) DEBUG="-g -g3 -gdwarf-2 -D DEBUG"