-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
155 lines (108 loc) · 4.11 KB
/
Copy pathMakefile
File metadata and controls
155 lines (108 loc) · 4.11 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#
# COMMON module makefile
#
#----------------------------------------------------------------------------
# Project specific path defintions.
#----------------------------------------------------------------------------
M_INCL_DIR = ../include
M_LIB_DIR = ../lib
PROJ_DIR = .
L_INCL_DIR = $(PROJ_DIR)/include
SRC_DIR = $(PROJ_DIR)/src
OBJ_DIR = $(PROJ_DIR)/obj
L_LIB_DIR = $(PROJ_DIR)/lib
VPATH = $(OBJ_DIR)
#----------------------------------------------------------------------------
# LINCLUDES and LDEFINES are appended to CFLAGS and C++FLAGS
#----------------------------------------------------------------------------
LDEFINES =
LINCLUDES = -I$(L_INCL_DIR) -I$(M_INCL_DIR)
#----------------------------------------------------------------------------
# Include the appropriate compiler/platform definitions ...
#----------------------------------------------------------------------------
include ../etc/Makefile.platform
# Dependent libraries
ALL_DEP_LIBS =
# Module libraries
MOD_LIB = common.a
# Agregate library
AGR_LIB = all.a
# Temporary library. Used to obtain the agregate library.
TMP_LIB = tmp.a
L_MOD_LIB = $(L_LIB_DIR)/$(MOD_LIB)
M_MOD_LIB = $(M_LIB_DIR)/$(MOD_LIB)
L_AGR_LIB = $(L_LIB_DIR)/$(AGR_LIB)
M_AGR_LIB = $(M_LIB_DIR)/$(AGR_LIB)
# Base file names. Must have ".ext" at the end of the file.
BASE_REGULAR_FILES = RcsbPlatform.ext \
RcsbFile.ext \
BlockIO.ext \
Serializer.ext \
GenString.ext \
CifString.ext \
GenCont.ext \
Exceptions.ext \
DataInfo.ext
BASE_TEMPLATE_FILES = mapped_vector.ext \
mapped_ptr_vector.ext
BASE_FILES = $(BASE_REGULAR_FILES) $(BASE_TEMPLATE_FILES)
# Base template source files. Replace ".ext" with ".C"
BASE_TEMPLATE_SRC_FILES = ${BASE_TEMPLATE_FILES:.ext=.C}
# Source files. Replace ".ext" with ".C"
SRC_FILES = ${BASE_FILES:.ext=.C}
# Object files. Replace ".ext" with ".o"
OBJ_FILES = ${BASE_FILES:.ext=.o}
# Base header files. Replace ".ext" with ".h"
BASE_HEADER_FILES = ${BASE_FILES:.ext=.h}
EXTRA_HEADER_FILES = CifDefs.h rcsb_types.h rcsb_math.h
HEADER_FILES = $(BASE_HEADER_FILES) $(EXTRA_HEADER_FILES)
ALL_OBJ_FILES = *.o
.PHONY: ../etc/Makefile.platform all install export clean clean_build
all: install
install: $(M_MOD_LIB)
export:
mkdir -p $(EXPORT_DIR)
@cp Makefile $(EXPORT_DIR)
@cd $(EXPORT_DIR); mkdir -p $(L_INCL_DIR)
@cd $(L_INCL_DIR); $(EXPORT) $(EXPORT_LIST) $(HEADER_FILES) ../$(EXPORT_DIR)/$(L_INCL_DIR)
@cd $(EXPORT_DIR); mkdir -p $(SRC_DIR)
@cd $(SRC_DIR); $(EXPORT) $(EXPORT_LIST) $(SRC_FILES) ../$(EXPORT_DIR)/$(SRC_DIR)
@cd $(EXPORT_DIR); mkdir -p $(OBJ_DIR)
@cd $(EXPORT_DIR); mkdir -p $(L_LIB_DIR)
clean: clean_build
$(M_MOD_LIB): $(L_MOD_LIB)
# Install header files
@cd $(L_INCL_DIR); \
../$(INSTALL) $(INSTALLOPTS) $(HEADER_FILES) ../$(M_INCL_DIR)
@cd $(SRC_DIR); \
../$(INSTALL) $(INSTALLOPTS) $(BASE_TEMPLATE_SRC_FILES) ../$(M_INCL_DIR)
# Install module library
$(INSTALL) $(INSTALLOPTS) $(L_MOD_LIB) $(M_LIB_DIR)
# Install agregate library
@cd $(M_LIB_DIR); ../etc/initlib.sh $(MOD_LIB)
@cd $(L_LIB_DIR); cp ../$(M_AGR_LIB) $(TMP_LIB)
@cd $(L_LIB_DIR); $(AR) $(AR_GETFLAGS) $(TMP_LIB)
@cd $(L_LIB_DIR); rm -f $(TMP_LIB)
@cd $(L_LIB_DIR); cp $(MOD_LIB) $(TMP_LIB)
@cd $(L_LIB_DIR); $(AR) $(AR_GETFLAGS) $(TMP_LIB)
@cd $(L_LIB_DIR); rm -f $(TMP_LIB)
@cd $(L_LIB_DIR); $(AR) $(AR_PUTFLAGS) $(AGR_LIB) $(ALL_OBJ_FILES)
@cd $(L_LIB_DIR); rm -f $(ALL_OBJ_FILES)
$(INSTALL) $(INSTALLOPTS) $(L_AGR_LIB) $(M_LIB_DIR)
@rm -f $(L_AGR_LIB)
clean_build:
@cd $(M_INCL_DIR); rm -f $(HEADER_FILES); \
rm -rf $(BASE_TEMPLATE_SRC_FILES)
@rm -f $(OBJ_DIR)/*.o
@rm -rf $(OBJ_DIR)/ii_files
@rm -f $(L_MOD_LIB)
@rm -f $(M_MOD_LIB)
@rm -f $(M_AGR_LIB)
$(L_MOD_LIB): $(OBJ_FILES)
# Create module library
@cd $(OBJ_DIR); $(AR) $(AR_PUTFLAGS) ../$@ $(OBJ_FILES)
$(RANLIB) $@
@echo $@ " is up to date."
# Rule for making object files
%.o: $(SRC_DIR)/%.C
$(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@