-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
80 lines (58 loc) · 2.36 KB
/
Copy pathmakefile
File metadata and controls
80 lines (58 loc) · 2.36 KB
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
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of test (for TwoStageStochasticBlock) #
# #
# Benoît Tran #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# module name
NAME = TSSB_test
# basic directory
DIR = .
# compiler
CC = clang++
# common flags
COMMON_SW = -std=c++20 -ferror-limit=1 -Wno-enum-compare -DCLANG_1200_0_32_27_PATCH
# debug switches
SW_DEBUG = -g3 -glldb -fno-inline $(COMMON_SW)
# production switches
SW_RELEASE = -O3 $(COMMON_SW) -DNDEBUG
# default target - build in release mode
default: SW = $(SW_RELEASE)
default: $(DIR)/$(NAME)
# debug target - build in debug mode
debug: SW = $(SW_DEBUG)
debug: $(DIR)/$(NAME)
# define & include the necessary modules- - - - - - - - - - - - - - - - - - -
# SMS++
SMS++SDR = ../../SMS++
include $(SMS++SDR)/lib/makefile-inc
# TwoStageStochasticBlock
TSSBkSDR = ..
include $(TSSBkSDR)/makefile-s
# main module (linking phase) - - - - - - - - - - - - - - - - - - - - - - - -
# object files
MOBJ = $(TSSBkOBJ) $(SMS++OBJ)
# libraries (need to explicitly include dependencies' libraries since TSSBkLIB is empty)
MLIB = $(TSSBkLIB) $(StcBlkLIB) $(SMS++LIB)
$(DIR)/$(NAME): $(MOBJ) $(DIR)/test.o
$(CC) -o $(DIR)/$(NAME) $(DIR)/test.o $(MOBJ) $(MLIB) $(SW)
# dependencies: every .o from its .cpp + every recursively included .h- - - -
# include directives
MINC = $(SMS++INC) $(TSSBkINC)
# includes
MH = $(SMS++H) $(TSSBkH)
# compile command
$(DIR)/test.o: $(DIR)/test.cpp $(MH)
$(CC) -c $(DIR)/test.cpp -o $@ $(MINC) $(SW)
# clean target
clean::
rm -f $(DIR)/*.o $(DIR)/*~
rm -f $(DIR)/$(NAME)
# phony targets
.PHONY: default debug clean
############################ End of makefile #################################