source: trunk/src/Makefile @ 27

Last change on this file since 27 was 21, checked in by dkearney, 19 years ago

created Makefile for compiling rappture libraries.
created README which starts to outline how to compile a rappture library
adjusted #include lines in most .h,.c,.cc files and added Include path

searched to the makefile.

files changed listed below:
M include/core/RpUnits.h
M include/core/RpDict.h
M include/cee/rappture_interface.h
A src/python/PyRpUnits_setup.py
M src/core/RpUnits.cc
M src/fortran/RpUnits_fortran.c
M src/fortran/rappture_fortran.c
M src/cee/rappture_interface.c
M src/cee/RpUnitsCInterface.cc
A src/README
A src/Makefile

File size: 4.2 KB
Line 
1# define which programs this effects
2PROGS                   =       libRpUnits_CInterface   \
3                                        libRpUnits_FInterface   \
4                                        librappture                             \
5                                        libRapptureIO                   \
6
7# define our compiling environment
8#
9AR                              = ar
10CC                              = gcc
11CPP                             = g++
12DEBUG                   = -g -Wall
13DEBUG_PLUS              = -g -DDEBUG
14
15# FORTRAN BINDINGS COMPILER FLAGS
16#
17# available flags
18#
19#       COMPNAME_NOCHANGE               -       No change to the Rappture Library function
20#                                                               name
21#       COMPNAME_UPPERCASE      -       Replace the Rappture Library function name
22#                                                               with an all uppercase version of the name
23#       COMPNAME_ADD1UNDERSCORE -       add 1 underscore to the end of the Rappture
24#                                                               Library function name
25#       COMPNAME_ADD2UNDERSCORE -       add 2 underscores to the end of the Rappture
26#                                                               Library function name
27#
28# when setting CFLAGS, use the following guide for help
29#
30# gnu's g77/f77                 COMPNAME_ADD2UNDERSCORE
31# absoft's f77                  COMPNAME_ADD1UNDERSCORE
32# intel's ifort                 COMPNAME_ADD1UNDERSCORE
33# intel's mpif90                COMPNAME_ADD1UNDERSCORE
34#
35#
36
37CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
38
39 F77                    = g77
40#F77                            = f77
41#F77                            = ifort
42#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
43
44LN              = ln
45
46# define our directories
47#
48WORK_DIR                = ../work
49INCLUDES_DIR    = ../include
50SRC_DIR                 = core
51FORT_SRC                = fortran
52CEE_SRC                 = cee
53PY_SRC                  = python
54BIN_DIR                 = ../bin
55LIB_DIR                 = ../lib
56
57#LIB_RPUNITS    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits
58#LIB_RPDICT             = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpDict
59
60LIB_RPUNITS_C   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_CInterface
61LIB_RPUNITS_F   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_FInterface
62LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
63LIB_RAPPTUREIO  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRapptureIO
64
65INCL_CORE               = -I $(INCLUDES_DIR)/core
66INCL_CEE                = -I $(INCLUDES_DIR)/cee
67INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
68INCL_PY                 = -I $(INCLUDES_DIR)/python
69
70# you need to change this to where your version of python is installed.
71EMB_PY_FLAGS    = -L$(LIB_DIR) -lpython2.4
72
73# tell make where to find files of each specific type
74#
75vpath %.o $(WORK_DIR)
76vpath %.so $(LIB_DIR)
77vpath %.h $(INCLUDES_DIR)
78#vpath %.c $(SRC_DIR)
79#vpath %.cc $(SRC_DIR)
80#vpath %.tcc $(SRC_DIR)
81#vpath %.cpp $(SRC_DIR)
82
83
84# default:
85
86all: ${PROGS}
87
88#### librappture shared object ###########################################
89
90libRpUnits_CInterface: $(WORK_DIR)/RpUnitsCInterface.o $(WORK_DIR)/RpUnitsStd.o $(WORK_DIR)/RpUnits.o
91        $(CPP) $(DEGUG) -shared -Wl,-rpath,../lib \
92                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lc
93       
94        /sbin/ldconfig -n $(LIB_DIR)
95
96libRpUnits_FInterface: $(WORK_DIR)/RpUnitsStd.o $(WORK_DIR)/RpUnits.o $(WORK_DIR)/RpUnits_fortran.o
97        $(CPP) $(DEBUG) -shared -Wl,-rpath,../lib \
98        -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++
99       
100        /sbin/ldconfig -n $(LIB_DIR)
101
102librappture: $(WORK_DIR)/rappture_fortran.o $(WORK_DIR)/rappture_interface.o
103        $(CC) $(DEGUG) -shared -Wl,-rpath,../lib \
104                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS) -lstdc++
105               
106        /sbin/ldconfig -n $(LIB_DIR)
107   
108libRapptureIO: $(WORK_DIR)/rappture_fortran.o $(WORK_DIR)/rappture_interface.o
109        $(CC) $(DEGUG) -shared -Wl,-rpath,../lib \
110                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS) -lstdc++
111               
112        /sbin/ldconfig -n $(LIB_DIR)
113   
114
115# -fPIC is for Platform Independent Code, used when creating shared objects.
116
117$(WORK_DIR)/RpUnits.o: $(SRC_DIR)/RpUnits.cc
118        $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
119
120$(WORK_DIR)/RpUnitsStd.o: $(SRC_DIR)/RpUnitsStd.cc
121        $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
122
123$(WORK_DIR)/RpDict.o: $(SRC_DIR)/RpDict.cc
124        $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
125
126$(WORK_DIR)/rappture_interface.o: $(CEE_SRC)/rappture_interface.c
127        $(CPP) -fPIC $(DEBUG) $(INCL_CEE) -o $(WORK_DIR)/$@ -c $<
128
129$(WORK_DIR)/RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
130        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE)  -o $@ -c $?
131
132$(WORK_DIR)/RpUnits_fortran.o: $(FORT_SRC)/RpUnits_fortran.c
133        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
134
135$(WORK_DIR)/rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
136        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $(WORK_DIR)/$@ -c $<
137
138
139#### CLEAN UP ############################################################
140clean:
141        - rm -f $(BIN_DIR)/* $(WORK_DIR)/*.o
Note: See TracBrowser for help on using the repository browser.