Changeset 33


Ignore:
Timestamp:
Jul 27, 2005 3:19:44 PM (19 years ago)
Author:
dkearney
Message:

separated make file into components to be included to create larger makefiles so i could compile stuff in rappture/examples/fermi_fortran using the make.inc's in the src dirs

Location:
trunk/src
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile

    r21 r33  
    1 # define which programs this effects
     1# define the top of our directory structure
     2# replace this with the full path of the directory
     3# containing the rappture directory
     4TOP_DIR         = ../..
     5
     6# define the top of the rappture directory structure
     7RP_BASE   = $(TOP_DIR)/rappture
     8
     9# define which programs can be made
    210PROGS                   =       libRpUnits_CInterface   \
    311                                        libRpUnits_FInterface   \
     
    3543#
    3644
    37 CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
     45CFLAGS                  = -DCOMPNAME_ADD1UNDERSCORE
    3846
    39  F77                    = g77
     47#F77                    = g77
    4048#F77                            = f77
    4149#F77                            = ifort
    42 #F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
     50F77                             = /opt/mpich-1.2.6/p4-intel/bin/mpif90
    4351
    4452LN              = ln
     
    4654# define our directories
    4755#
    48 WORK_DIR                = ../work
    49 INCLUDES_DIR    = ../include
    50 SRC_DIR                 = core
    51 FORT_SRC                = fortran
    52 CEE_SRC                 = cee
    53 PY_SRC                  = python
    54 BIN_DIR                 = ../bin
    55 LIB_DIR                 = ../lib
     56WORK_DIR                = $(RP_BASE)/work
     57INCLUDES_DIR    = $(RP_BASE)/include
     58BIN_DIR                 = $(RP_BASE)/bin
     59LIB_DIR                 = $(RP_BASE)/lib
     60SRC_DIR                 = $(RP_BASE)/src
     61
     62CORE_SRC                = $(SRC_DIR)/core
     63FORT_SRC                = $(SRC_DIR)/fortran
     64CEE_SRC                 = $(SRC_DIR)/cee
     65PY_SRC                  = $(SRC_DIR)/python
    5666
    5767#LIB_RPUNITS    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits
     
    7686vpath %.so $(LIB_DIR)
    7787vpath %.h $(INCLUDES_DIR)
    78 #vpath %.c $(SRC_DIR)
    79 #vpath %.cc $(SRC_DIR)
    80 #vpath %.tcc $(SRC_DIR)
    81 #vpath %.cpp $(SRC_DIR)
     88#vpath %.c $(CORE_SRC)
     89#vpath %.cc $(CORE_SRC)
     90#vpath %.tcc $(CORE_SRC)
     91#vpath %.cpp $(CORE_SRC)
    8292
    8393
     
    8696all: ${PROGS}
    8797
    88 #### librappture shared object ###########################################
     98# include rappture library definitions
     99include $(SRC_DIR)/make.inc
    89100
    90 libRpUnits_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)
     101# include core source files
     102include $(CORE_SRC)/make.inc
    95103
    96 libRpUnits_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)
     104# include cee binding definitions
     105include $(CEE_SRC)/make.inc
    101106
    102 librappture: $(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# include fortran binding definitions
     108include $(FORT_SRC)/make.inc
     109
    107110   
    108 libRapptureIO: $(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 
    139111#### CLEAN UP ############################################################
    140112clean:
    141         - rm -f $(BIN_DIR)/* $(WORK_DIR)/*.o
     113        - rm -f $(BIN_DIR)/* $(WORK_DIR)/*.o $(LIB_DIR)/librappture.* $(LIB_DIR)/libR*.so*
Note: See TracChangeset for help on using the changeset viewer.