source: trunk/test/Makefile @ 77

Last change on this file since 77 was 77, checked in by dkearney, 15 years ago
  1. initial checkin of RpLibrary? code, includes c++/c/fortran bindings
  2. minor modifications to makefiles to accommodate new code
  3. updated README in src to tell how to compile code in src and test
File size: 3.6 KB
Line 
1
2# tell make where to find the libscew sources
3SCEW_HEADERS    = /opt/rappture/include/scew
4LIB_SCEW_INCL   = -I $(SCEW_HEADERS)
5LIB_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
11TOP_DIR         = ../..
12
13# define the top of the rappture directory structure
14RP_BASE   = $(TOP_DIR)/rappture
15
16# define which programs can be made
17                                       
18TEST_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#
31CC                              = gcc
32CXX                             = g++
33DEBUG                   = -g -Wall
34DEBUG_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
58CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
59
60F77                     = g77
61
62LN              = ln
63
64# define our directories
65#
66INCLUDES_DIR    = $(RP_BASE)/include
67BIN_DIR                 = $(RP_BASE)/bin
68LIB_DIR                 = $(RP_BASE)/src
69SRC_DIR                 = $(RP_BASE)/src
70TEST_DIR                = $(RP_BASE)/test
71
72LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
73
74LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
75LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
76LIB_RAPPTURE_T  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test
77
78INCL_CORE               = -I $(INCLUDES_DIR)/core
79INCL_CEE                = -I $(INCLUDES_DIR)/cee
80INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
81INCL_PY                 = -I $(INCLUDES_DIR)/python
82
83# default:
84
85all: $(TEST_PROGS)
86test: $(TEST_PROGS)
87
88# include test programs
89
90SRC_TEST            = $(TEST_DIR)/src
91
92
93RpBoolean_test: $(SRC_TEST)/RpBoolean_test.cc
94        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS)
95   
96RpChoice_test: $(SRC_TEST)/RpChoice_test.cc
97        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS)
98   
99RpNumber_test: $(SRC_TEST)/RpNumber_test.cc
100        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS)
101
102RpString_test: $(SRC_TEST)/RpString_test.cc
103        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS)
104
105RpUnits_test: $(SRC_TEST)/RpUnits_test.cc
106        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RAPPTURE)
107
108RpVariable_test: $(SRC_TEST)/RpVariable_test.cc
109        $(CXX) $(DEBUG) $(INCL_CORE) -o $@ $< $(LIB_RP_OBJECTS)
110
111RpUnitsC_test: $(SRC_TEST)/RpUnitsC_test.c
112        $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $@ $^ $(LIB_RAPPTURE_T)
113
114RpLibrary_test: $(SRC_TEST)/RpLibrary_test.cc
115        $(CXX) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE_T)
116
117RpLibraryCInterface_test: $(SRC_TEST)/RpLibraryCInterface_test.c
118        $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE_T)
119
120RpUnitsF_test: $(SRC_TEST)/RpUnitsF_test.f
121        $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE_T)
122
123
124#### CLEAN UP ############################################################
125clean:
126        - rm -f *.o $(TEST_PROGS)
Note: See TracBrowser for help on using the repository browser.