-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (47 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
CXX=g++
FLAGS=-L$(OUTPUTDIR) -std=c++17 -lpthread -lwiringPi -ldl -lssl -latomic -lcrypto
DEFINES=
ifdef SSL
DEFINES+=-DCROW_ENABLE_SSL
endif
ifndef RELEASE
DEBUG=-g3
$(shell mkdir -p intermediates/debug)
OUTPUTDIR ?=$(shell pwd)/intermediates/debug
FINALOUTPUT=build/debug
else
DEBUG=-O3
$(shell mkdir -p intermediates/release)
OUTPUTDIR ?=$(shell pwd)/intermediates/release
FINALOUTPUT=build/release
endif
export DEFINES
export FLAGS
export DEBUG
export OUTPUTDIR
export COMPILER_PREFIX
.PHONY:all
all:libwiringpi sqlite sha thermostat
mkdir -p $(FINALOUTPUT)
$(COMPILER_PREFIX)g++ -o $(FINALOUTPUT)/site $(shell ls $(OUTPUTDIR)/*.o) $(FLAGS)
cp -r build/additional_files/* $(FINALOUTPUT)
.PHONY:sha
sha:
$(MAKE) -C dependencies/includes/sha/
.PHONY:sqlite
sqlite:
$(MAKE) -C dependencies/includes/sqlite/
.PHONY:libwiringpi
libwiringpi:
ifeq '$(shell ldconfig -p | grep libwiringPi)' ''
$(MAKE) -C dependencies/includes/WiringPi/wiringPi/
cp dependencies/includes/WiringPi/wiringPi/libwiringPi.so.* $(OUTPUTDIR)/libwiringPi.so
endif
.PHONY:thermostat
thermostat:
$(MAKE) -C src/ all
.PHONY:clean
clean:
rm -f intermediates/debug/*
rm -f intermediates/release/*
$(MAKE) -C dependencies/includes/WiringPi/wiringPi/ clean