forked from groops-devs/groops
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
87 lines (67 loc) · 1.72 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
#-------------------------------------------------------------------------------
#
# makefile
#
# Purpose:
#
# Linux make file for software libraries
#
# Last modified:
#
# 2022/12/09 AHA Created
# 2024/11/12 AHA Add build target for documentation
# 2024/11/12 AHA Remove and re-create xsd schema file
#
#-------------------------------------------------------------------------------
# Paths
GROOPS = .
GROOPS_bin = $(GROOPS)/bin
GROOPS_doc = $(GROOPS)/docs
GROOPS_gui = $(GROOPS)/gui
GROOPS_bld = $(GROOPS)/source/build
# Get number of parallel build jobs
ifneq ($(shell which nproc 2> /dev/null),)
NJOBS = $(shell nproc)
else
NJOBS = 1
endif
# Parallel compilation on Linux and Cygwin
PMAKE = make
OS = $(shell uname -o)
ifeq ($(OS),GNU/Linux)
PMAKE = make -j $(NJOBS)
endif
ifeq ($(OS),Cygwin)
PMAKE = make -j $(NJOBS)
endif
# Operating system dependent settings for qmake
#
# Default: use standard qmake
QMAKE = qmake
# Linux: use qmake or qmake-qt5
ifeq ($(OS),GNU/Linux)
ifeq ($(shell which qmake-qt5 2> /dev/null),)
QMAKE = qmake
else
QMAKE = qmake-qt5 # if qmake is not available (e.g. openSuse)
endif
endif
# Targets
all: init \
groops_ groopsgui_
# Create directory tree
init:
if [ ! -d "$(GROOPS_bld)" ]; then mkdir -p $(GROOPS_bld); fi
groops_:
cd $(GROOPS_bld); cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../..; $(PMAKE); make install
rm groops.xsd; groops --xsd groops.xsd
groopsgui_:
cd $(GROOPS_gui); $(QMAKE); $(PMAKE)
# Documentation
doc:
cd $(GROOPS_doc); ./makeDocumentation.sh
# Clean up
clean:
if [ -d "$(GROOPS_bin)" ]; then cd $(GROOPS_bin); rm -f *; fi
if [ -d "$(GROOPS_bld)" ]; then cd $(GROOPS_bld); make clean; fi
cd $(GROOPS_gui); make clean