Changeset 73 for trunk/src/Makefile


Ignore:
Timestamp:
Sep 28, 2005, 12:09:43 AM (19 years ago)
Author:
dkearney
Message:
  1. changes to RpUnits, modified RpUnits::define() function not to look for base units.
  2. changed python RpUnits to return string when units!="off" and a number when units=="off"
  3. modified make files, hopefully making them easier to read, removing vpaths,

cleaning up the make process, combining smaller libraries into one library,
librappture, and putting the core objects into one library - libRpObjects,
for testing.

  1. copied rpResult function into rappture_interface.c to stop compiler from

complaining about undefined references ot the function. trying to use the
function probably won't work. but that can be fixed after the repository is
reorganized.

  1. in example/app-fermi/python/fermi.py, changed exit() to sys.exit() to

stop python from complaining about no function called exit().

  1. examples/app-fermi/fortran still does not run, but new rappture parser

should take care of these problems. (same with examples/fermi_fortran)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile

    r41 r73  
     1# you need to change this to where your version of python is installed.
     2# tell make where to find python header files
     3PY_SRC_HEADERS  = /opt/rappture/include/python2.4
     4
     5# tell make where to find the python shared library
     6EMB_PY_LIB_FLAG = -lpython2.4
     7EMB_PY_LIB_DIR  = /opt/rappture/lib
     8
     9EMB_PY_FLAGS    = -Wl,-rpath,$(EMB_PY_LIB_DIR) -L$(EMB_PY_LIB_DIR) $(EMB_PY_LIB_FLAG)
     10
     11# everything below should be ok, but check to make sure
     12# especially check the fortran flags, if youre using fortran
     13#
    114# define the top of our directory structure
    215# replace this with the full path of the directory
     
    821
    922# define which programs can be made
    10 PROGS                   =       libRpUnits_CInterface   \
    11                                         libRpUnits_FInterface   \
    12                                         librappture                             \
    13                                         libRapptureIO                   \
    14                                         libRpUnits                              \
    15                                         libRpVariable                   \
    16                                         libRpNumber                             \
    17                                         libRpString                             \
    18                                         libRpBoolean                    \
    19                                         libRpChoice                             \
    20                                         libRpOption                             
    21                                        
     23PROGS                   =       librappture                             \
     24                                        libRpObjects                    \
    2225
    2326# define our compiling environment
    2427#
    25 AR                              = ar
    2628CC                              = gcc
    2729CPP                             = g++
     
    6264# define our directories
    6365#
    64 WORK_DIR                = $(RP_BASE)/work
    6566INCLUDES_DIR    = $(RP_BASE)/include
    6667BIN_DIR                 = $(RP_BASE)/bin
    67 LIB_DIR                 = $(RP_BASE)/lib
     68LIB_DIR                 = $(RP_BASE)/src
    6869SRC_DIR                 = $(RP_BASE)/src
    6970TEST_DIR                = $(RP_BASE)/test
     
    7475PY_SRC                  = $(SRC_DIR)/python
    7576
    76 #LIB_RPUNITS    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits
    77 #LIB_RPDICT             = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpDict
    78 
    7977LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
    80 
    81 #LIB_RPUNITS_C   = $(LIB_INC_PREFIX) -lRpUnits_CInterface
    82 #LIB_RAPPTUREIO  = $(LIB_INC_PREFIX) -lrappture
    83 
    84 LIB_RP_UNITS    = $(LIB_INC_PREFIX) -lRpUnits
    85 LIB_RP_VARIABLE = $(LIB_INC_PREFIX) -lRpVariable
    86 LIB_RP_NUMBER   = $(LIB_INC_PREFIX) -lRpNumber
    87 LIB_RP_STRING   = $(LIB_INC_PREFIX) -lRpString
    88 LIB_RP_BOOLEAN  = $(LIB_INC_PREFIX) -lRpBoolean
    89 LIB_RP_OPTION   = $(LIB_INC_PREFIX) -lRpOption
    90 LIB_RP_CHOICE   = $(LIB_INC_PREFIX) -lRpChoice
    91 LIB_RP_PRESET   = $(LIB_INC_PREFIX) -lRpPreset
    92 
    93 
    94 LIB_RPUNITS_C   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_CInterface
    95 LIB_RPUNITS_F   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_FInterface
     78LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
    9679LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
    97 LIB_RAPPTUREIO  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRapptureIO
    9880
    9981INCL_CORE               = -I $(INCLUDES_DIR)/core
    100 INCL_CEE                = -I $(INCLUDES_DIR)/cee
     82INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
    10183INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
    10284INCL_PY                 = -I $(INCLUDES_DIR)/python
    103 
    104 # you need to change this to where your version of python is installed.
    105 EMB_PY_FLAGS    = -L$(LIB_DIR) -lpython2.4
    106 
    107 # tell make where to find files of each specific type
    108 #
    109 vpath %.o $(WORK_DIR)
    110 vpath %.so $(LIB_DIR)
    111 vpath %.h $(INCLUDES_DIR)
    112 #vpath %.c $(CORE_SRC)
    113 #vpath %.cc $(CORE_SRC)
    114 #vpath %.tcc $(CORE_SRC)
    115 #vpath %.cpp $(CORE_SRC)
    11685
    11786
     
    12190
    12291# include rappture library definitions
    123 include $(SRC_DIR)/make.inc
     92
     93#### librappture shared object ###########################################
     94
     95librappture: rappture_fortran.o rappture_interface.o RpUnitsCInterface.o RpUnitsStd.o RpUnits.o
     96        $(CPP) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
     97                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS)
     98
     99        /sbin/ldconfig -n $(LIB_DIR)
     100
     101
     102#### libRpObjects ########################################################
     103libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
     104        $(CPP) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
     105                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lc
     106       
     107        /sbin/ldconfig -n $(LIB_DIR)
     108
    124109
    125110# include core source files
    126 include $(CORE_SRC)/make.inc
     111
     112Rp%.o: $(CORE_SRC)/Rp%.cc
     113        $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
    127114
    128115# include cee binding definitions
    129 include $(CEE_SRC)/make.inc
     116
     117rappture_interface.o: $(CEE_SRC)/rappture_interface.c
     118        $(CPP) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
     119
     120RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
     121        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
    130122
    131123# include fortran binding definitions
    132 include $(FORT_SRC)/make.inc
    133124
    134 # include test programs
    135 include $(TEST_DIR)/make.inc
     125RpUnits_fortran.o: $(FORT_SRC)/RpUnits_fortran.c
     126        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
     127
     128rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
     129        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
    136130
    137131#### CLEAN UP ############################################################
    138132clean:
    139         - rm -f $(BIN_DIR)/* $(WORK_DIR)/*.o $(LIB_DIR)/librappture.* $(LIB_DIR)/libR*.so*
     133        - rm -f $(BIN_DIR)/* *.o librappture.* libR*.so*
Note: See TracChangeset for help on using the changeset viewer.