1 | |
---|
2 | # tell make where to find the libscew sources |
---|
3 | SCEW_HEADERS = /opt/rappture/include/scew |
---|
4 | LIB_SCEW_INCL = -I $(SCEW_HEADERS) |
---|
5 | LIB_SCEW_FLAG = -L/opt/rappture/lib -lscew |
---|
6 | #LIB_SCEW_FLAG = -static -L/opt/rappture/lib -lscew |
---|
7 | |
---|
8 | # define the top of our directory structure |
---|
9 | # replace this with the full path of the directory |
---|
10 | # containing the rappture directory |
---|
11 | TOP_DIR = ../.. |
---|
12 | |
---|
13 | # define the top of the rappture directory structure |
---|
14 | RP_BASE = $(TOP_DIR)/rappture |
---|
15 | |
---|
16 | # define which programs can be made |
---|
17 | |
---|
18 | TEST_PROGS = RpBoolean_test \ |
---|
19 | RpChoice_test \ |
---|
20 | RpNumber_test \ |
---|
21 | RpString_test \ |
---|
22 | RpUnits_test \ |
---|
23 | RpVariable_test \ |
---|
24 | RpUnitsC_test \ |
---|
25 | RpUnitsF_test \ |
---|
26 | RpLibrary_test \ |
---|
27 | RpLibraryCInterface_test |
---|
28 | |
---|
29 | # define our compiling environment |
---|
30 | # |
---|
31 | CC = gcc |
---|
32 | CXX = g++ |
---|
33 | DEBUG = -g -Wall |
---|
34 | DEBUG_PLUS = -g -DDEBUG |
---|
35 | |
---|
36 | # FORTRAN BINDINGS COMPILER FLAGS |
---|
37 | # |
---|
38 | # available flags |
---|
39 | # |
---|
40 | # COMPNAME_NOCHANGE - No change to the Rappture Library function |
---|
41 | # name |
---|
42 | # COMPNAME_UPPERCASE - Replace the Rappture Library function name |
---|
43 | # with an all uppercase version of the name |
---|
44 | # COMPNAME_ADD1UNDERSCORE - add 1 underscore to the end of the Rappture |
---|
45 | # Library function name |
---|
46 | # COMPNAME_ADD2UNDERSCORE - add 2 underscores to the end of the Rappture |
---|
47 | # Library function name |
---|
48 | # |
---|
49 | # when setting CFLAGS, use the following guide for help |
---|
50 | # |
---|
51 | # gnu's g77/f77 COMPNAME_ADD2UNDERSCORE |
---|
52 | # absoft's f77 COMPNAME_ADD1UNDERSCORE |
---|
53 | # intel's ifort COMPNAME_ADD1UNDERSCORE |
---|
54 | # intel's mpif90 COMPNAME_ADD1UNDERSCORE |
---|
55 | # |
---|
56 | # |
---|
57 | |
---|
58 | CFLAGS = -DCOMPNAME_ADD2UNDERSCORE |
---|
59 | |
---|
60 | F77 = g77 |
---|
61 | |
---|
62 | LN = ln |
---|
63 | |
---|
64 | # define our directories |
---|
65 | # |
---|
66 | INCLUDES_DIR = $(RP_BASE)/include |
---|
67 | BIN_DIR = $(RP_BASE)/bin |
---|
68 | LIB_DIR = $(RP_BASE)/src |
---|
69 | SRC_DIR = $(RP_BASE)/src |
---|
70 | TEST_DIR = $(RP_BASE)/test |
---|
71 | |
---|
72 | LIB_INC_PREFIX = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) |
---|
73 | |
---|
74 | LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects |
---|
75 | LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture |
---|
76 | LIB_RAPPTURE_T = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test |
---|
77 | |
---|
78 | INCL_CORE = -I $(INCLUDES_DIR)/core |
---|
79 | INCL_CEE = -I $(INCLUDES_DIR)/cee |
---|
80 | INCL_FORTRAN = -I $(INCLUDES_DIR)/fortran |
---|
81 | INCL_PY = -I $(INCLUDES_DIR)/python |
---|
82 | |
---|
83 | # default: |
---|
84 | |
---|
85 | all: $(TEST_PROGS) |
---|
86 | test: $(TEST_PROGS) |
---|
87 | |
---|
88 | # include test programs |
---|
89 | |
---|
90 | SRC_TEST = $(TEST_DIR)/src |
---|
91 | |
---|
92 | |
---|
93 | RpBoolean_test: $(SRC_TEST)/RpBoolean_test.cc |
---|
94 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS) |
---|
95 | |
---|
96 | RpChoice_test: $(SRC_TEST)/RpChoice_test.cc |
---|
97 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS) |
---|
98 | |
---|
99 | RpNumber_test: $(SRC_TEST)/RpNumber_test.cc |
---|
100 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS) |
---|
101 | |
---|
102 | RpString_test: $(SRC_TEST)/RpString_test.cc |
---|
103 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS) |
---|
104 | |
---|
105 | RpUnits_test: $(SRC_TEST)/RpUnits_test.cc |
---|
106 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RAPPTURE) |
---|
107 | |
---|
108 | RpVariable_test: $(SRC_TEST)/RpVariable_test.cc |
---|
109 | $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS) |
---|
110 | |
---|
111 | RpUnitsC_test: $(SRC_TEST)/RpUnitsC_test.c |
---|
112 | $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $@ $^ $(LIB_RAPPTURE_T) |
---|
113 | |
---|
114 | RpLibrary_test: $(SRC_TEST)/RpLibrary_test.cc |
---|
115 | $(CXX) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE_T) |
---|
116 | |
---|
117 | RpLibraryCInterface_test: $(SRC_TEST)/RpLibraryCInterface_test.c |
---|
118 | $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE_T) |
---|
119 | |
---|
120 | RpUnitsF_test: $(SRC_TEST)/RpUnitsF_test.f |
---|
121 | $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE_T) |
---|
122 | |
---|
123 | |
---|
124 | #### CLEAN UP ############################################################ |
---|
125 | clean: |
---|
126 | - rm -f *.o $(TEST_PROGS) |
---|