-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
90 lines (81 loc) · 3.5 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
##=====================================================================
## OpenGLCppWrapper: A C++11 OpenGL 'Core' wrapper.
## Copyright 2018-2022 Quentin Quadrat <lecrapouille@gmail.com>
##
## This file is part of OpenGLCppWrapper.
##
## OpenGLCppWrapper is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## OpenGLCppWrapper is distributedin the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with OpenGLCppWrapper. If not, see <http://www.gnu.org/licenses/>.
##=====================================================================
###################################################
# Project definition
#
TARGET = $(PROJECT)
DESCRIPTION = C++ Wrapper allowing to write OpenGL Core applications in few lines
BUILD_TYPE = debug
###################################################
# Location of the project directory and Makefiles
#
P := .
M := $(P)/.makefile
include $(P)/Makefile.common
###################################################
# Compile static and shared libraries
.PHONY: all
all: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE)
###################################################
# Compile and launch unit tests and generate the code coverage html report.
.PHONY: unit-tests
unit-tests:
@$(call print-simple,"Compiling unit tests")
@$(MAKE) -C tests coverage
###################################################
# Compile and launch unit tests and generate the code coverage html report.
.PHONY: check
check: unit-tests
###################################################
# Install project. You need to be root.
.PHONY: install
install: $(STATIC_LIB_TARGET) $(SHARED_LIB_TARGET) $(PKG_FILE)
@$(call INSTALL_DOCUMENTATION)
@$(call INSTALL_PROJECT_LIBRARIES)
@$(call INSTALL_PROJECT_HEADERS)
@$(call INSTALL_THIRDPART_FOLDER,json/include/nlohmann,nlohmann,)
@$(call INSTALL_THIRDPART_FOLDER,SOIL/include/SOIL,SOIL,-name "*.h")
@$(call INSTALL_THIRDPART_FOLDER,bullet3/usr/local/include/bullet,bullet,-name "*.h")
@$(call INSTALL_THIRDPART_FOLDER,bullet3/usr/local/include/bullet,,)
@$(call INSTALL_THIRDPART_FILES,imgui/backends,imgui/backends,-name "imgui_impl_glfw.h")
@$(call INSTALL_THIRDPART_FILES,imgui/backends,imgui/backends,-name "imgui_impl_opengl3.h")
@$(call INSTALL_THIRDPART_FILES,imgui,,-name "imgui.h")
@$(call INSTALL_THIRDPART_FILES,imgui,,-name "imconfig.h")
@$(call INSTALL_THIRDPART_FILES,units/include/units,units,-name "*.hpp")
###################################################
# Uninstall the project. You need to be root. FIXME: to be updated
#.PHONY: uninstall
#uninstall:
# @$(call print-simple,"Uninstalling",$(PREFIX)/$(TARGET))
# @rm $(PROJECT_EXE)
# @rm -r $(PROJECT_DATA_ROOT)
###################################################
# Clean the whole project.
.PHONY: veryclean
veryclean: clean
@rm -fr cov-int $(PROJECT).tgz *.log foo 2> /dev/null
@(cd tests && $(MAKE) -s clean)
@(cd examples/ && $(MAKE) -s clean)
@(cd editor/ && $(MAKE) -s clean)
@$(call print-simple,"Cleaning","$(PWD)/doc/html")
@rm -fr $(THIRDPART)/*/ doc/html 2> /dev/null
###################################################
# Sharable informations between all Makefiles
include $(M)/Makefile.footer