forked from AlloSphere-Research-Group/AlloSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (76 loc) · 3.31 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
91
92
93
94
95
96
97
98
#=========================================================================
# AlloSystem main Makefile
#=========================================================================
LIB_NAME = allosystem
include Makefile.common
# List of all the module directories
MODULE_DIRS := $(shell ls -d */ | grep allo)
#--------------------------------------------------------------------------
# Rules
#--------------------------------------------------------------------------
help:
@echo No rule specified.
@echo The possible rules are:
@echo " all .............. build all modules found in this directory"
@echo " allocore ......... build allocore"
@echo " alloutil ......... build allocore utilities extension"
@echo " alloGLV .......... build allocore/GLV binding"
@echo " allovsr .......... build allocore/vsr binding"
@echo " Gamma ............ build Gamma external"
@echo " GLV .............. build GLV external"
@echo " vsr .............. build vsr external [use with optional INSTALL_VSR_PCH flag set to 1 or 0]"
@echo " clean ............ clean all modules found in this directory"
@echo " gatherexamples ... create examples/ directory with symlinks to module examples"
all:
@for v in $(MODULE_DIRS); do\
$(MAKE) --no-print-directory -C $$v install DESTDIR=../$(BUILD_DIR) linkfile;\
done
allocore: FORCE
@$(MAKE) --no-print-directory -C $@ install DESTDIR=../$(BUILD_DIR) linkfile
alloutil: FORCE allocore
@$(MAKE) --no-print-directory -C $@ install DESTDIR=../$(BUILD_DIR) linkfile
allonect: FORCE allocore alloutil
@$(MAKE) --no-print-directory -C $@ install DESTDIR=../$(BUILD_DIR)
Gamma GLV: FORCE
@$(MAKE) --no-print-directory -C ../$@ install DESTDIR=$(CURDIR)/$(BUILD_DIR) linkfile
alloGLV: FORCE allocore GLV
@$(MAKE) --no-print-directory -C $@ install DESTDIR=../$(BUILD_DIR) linkfile
#Default Installs Precompiled Header -- set to 0 to avoid this copy
INSTALL_VSR_PCH = 1
vsr: FORCE
@echo "compiling versor library and installing to AlloSystem/build directory"
@$(MAKE) --no-print-directory -C ../$@ install INSTALL_PCH=$(INSTALL_VSR_PCH) DESTDIR=$(CURDIR)/$(BUILD_DIR) linkfile
allovsr: FORCE allocore
@$(MAKE) --no-print-directory -C $@ install DESTDIR=../$(BUILD_DIR) linkfile
clean:
@for v in $(MODULE_DIRS); do\
$(MAKE) --no-print-directory -C $$v clean;\
done
# Create symlinks to all examples/ directories found in modules
gatherexamples:
@install -d examples
@for v in $(subst /,,$(MODULE_DIRS)); do\
if [ -d $$v/examples/ ]; then\
cd examples/;\
ln -s ../$$v/examples/ $$v;\
cd ..;\
fi;\
done
# This attempts to determine what modules have been built by looking in the
# build directory.
BUILT_MODULES := $(basename $(shell ls $(BUILD_DIR)/lib/ 2> /dev/null))
BUILT_MODULES := $(subst lib,,$(BUILT_MODULES))
BUILT_MODULES := $(filter allo%, $(BUILT_MODULES))
# This is a hack to ensure that Gamma and GLV linker dependencies are included.
# A better, more general solution would involve having a user dependency
# directory that is scanned.
ifneq ($(shell ls $(BUILD_DIR)/lib/ 2> /dev/null | grep Gamma),)
BUILT_MODULES += ../Gamma/
endif
ifneq ($(shell ls $(BUILD_DIR)/lib/ 2> /dev/null | grep GLV),)
BUILT_MODULES += ../GLV/
endif
-include $(addsuffix /Makefile.link, $(BUILT_MODULES))
LDFLAGS += -L$(BUILD_DIR)/lib/
include Makefile.buildandrun
include Makefile.rules