forked from Almamu/lead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (40 loc) · 1.21 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
###### BUILD ######
#INCLUDES = -Isrc -I/usr/include -I/usr/include/qt -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtCore
INCLUDES = -Isrc `pkg-config --cflags Qt5Widgets`
COMPILER = clang -std=c++11 -Wall -O3 -fPIC -MMD $(INCLUDES) -c $< -o $@
MOC = moc $(INCLUDES) -o $@ $<
#LINKER = g++ -o $@ $^ -lQt5Xdg -lQt5Widgets -lQt5Gui -lQt5Core
LINKER = g++ -o $@ $^ `pkg-config --libs Qt5Widgets`
MKDIR = mkdir -p $(dir $@)
# this prevents make from deleting the generated moc_*.cpp files
# so that the including of the dep-files will not fail
.SECONDARY:
data/usr/bin/lead: build/main.o build/app.o build/sensor.o build/screenname.o build/moc_app.o build/moc_sensor.o build/moc_screenname.o
$(MKDIR)
$(LINKER)
build/%.o: src/%.cpp
$(MKDIR)
$(COMPILER)
build/moc_%.o: build/moc_%.cpp
$(MKDIR)
$(COMPILER)
build/moc_%.cpp: src/%.h
$(MKDIR)
$(MOC)
-include build/*.d
###### CLEAN ######
clean:
# rm -f build/*
# rm -f data/usr/bin/lead
rm -rf build
rm -rf data
.PHONY: clean
###### INSTALL ######
install: data/usr/bin/lead
# cp -r data/* /
install -m 755 data/usr/bin/lead /usr/bin/lead
.PHONY: install
###### UNINSTALL ######
uninstall:
rm -f /usr/bin/lead
.PHONY: uninstall