source: trunk/examples/c-example/Makefile @ 61

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

adding c-example of how to use the c interface for rappture

File size: 3.8 KB
Line 
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
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                             
21PROGS = plot
22                                       
23
24# define our compiling environment
25#
26AR                              = ar
27CC                              = gcc
28CPP                             = g++
29DEBUG                   = -g -Wall
30DEBUG_PLUS              = -g -DDEBUG
31
32# FORTRAN BINDINGS COMPILER FLAGS
33#
34# available flags
35#
36#       COMPNAME_NOCHANGE               -       No change to the Rappture Library function
37#                                                               name
38#       COMPNAME_UPPERCASE      -       Replace the Rappture Library function name
39#                                                               with an all uppercase version of the name
40#       COMPNAME_ADD1UNDERSCORE -       add 1 underscore to the end of the Rappture
41#                                                               Library function name
42#       COMPNAME_ADD2UNDERSCORE -       add 2 underscores to the end of the Rappture
43#                                                               Library function name
44#
45# when setting CFLAGS, use the following guide for help
46#
47# gnu's g77/f77                 COMPNAME_ADD2UNDERSCORE
48# absoft's f77                  COMPNAME_ADD1UNDERSCORE
49# intel's ifort                 COMPNAME_ADD1UNDERSCORE
50# intel's mpif90                COMPNAME_ADD1UNDERSCORE
51#
52#
53
54CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
55
56F77                     = g77
57#F77                            = f77
58#F77                            = ifort
59#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
60
61LN              = ln
62
63# define our directories
64#
65WORK_DIR                = $(RP_BASE)/work
66INCLUDES_DIR    = $(RP_BASE)/include
67BIN_DIR                 = $(RP_BASE)/bin
68LIB_DIR                 = $(RP_BASE)/lib
69SRC_DIR                 = $(RP_BASE)/src
70TEST_DIR                = $(RP_BASE)/test
71
72CORE_SRC                = $(SRC_DIR)/core
73FORT_SRC                = $(SRC_DIR)/fortran
74CEE_SRC                 = $(SRC_DIR)/cee
75PY_SRC                  = $(SRC_DIR)/python
76
77#LIB_RPUNITS    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits
78#LIB_RPDICT             = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpDict
79
80LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
81
82#LIB_RPUNITS_C   = $(LIB_INC_PREFIX) -lRpUnits_CInterface
83#LIB_RAPPTUREIO  = $(LIB_INC_PREFIX) -lrappture
84
85LIB_RP_UNITS    = $(LIB_INC_PREFIX) -lRpUnits
86LIB_RP_VARIABLE = $(LIB_INC_PREFIX) -lRpVariable
87LIB_RP_NUMBER   = $(LIB_INC_PREFIX) -lRpNumber
88LIB_RP_STRING   = $(LIB_INC_PREFIX) -lRpString
89LIB_RP_BOOLEAN  = $(LIB_INC_PREFIX) -lRpBoolean
90LIB_RP_OPTION   = $(LIB_INC_PREFIX) -lRpOption
91LIB_RP_CHOICE   = $(LIB_INC_PREFIX) -lRpChoice
92LIB_RP_PRESET   = $(LIB_INC_PREFIX) -lRpPreset
93
94
95LIB_RPUNITS_C   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_CInterface
96LIB_RPUNITS_F   = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRpUnits_FInterface
97LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
98LIB_RAPPTUREIO  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lRapptureIO
99
100INCL_CORE               = -I $(INCLUDES_DIR)/core
101INCL_CEE                = -I $(INCLUDES_DIR)/cee
102INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
103INCL_PY                 = -I $(INCLUDES_DIR)/python
104
105# you need to change this to where your version of python is installed.
106EMB_PY_FLAGS    = -L$(LIB_DIR) -lpython2.4
107
108# tell make where to find files of each specific type
109#
110vpath %.o $(WORK_DIR)
111vpath %.so $(LIB_DIR)
112vpath %.h $(INCLUDES_DIR)
113#vpath %.c $(CORE_SRC)
114#vpath %.cc $(CORE_SRC)
115#vpath %.tcc $(CORE_SRC)
116#vpath %.cpp $(CORE_SRC)
117
118
119# default:
120
121all: ${PROGS} plot
122
123# include rappture library definitions
124#include $(SRC_DIR)/make.inc
125
126# include core source files
127#include $(CORE_SRC)/make.inc
128
129# include cee binding definitions
130#include $(CEE_SRC)/make.inc
131
132# include fortran binding definitions
133#include $(FORT_SRC)/make.inc
134
135# include test programs
136#include $(TEST_DIR)/make.inc
137
138# include new example
139include $(RP_BASE)/examples/c-example/make.inc
140
141#### CLEAN UP ############################################################
142clean:
143        rm -f plot
144#clean:
145#       - rm -f $(BIN_DIR)/* $(WORK_DIR)/*.o $(LIB_DIR)/librappture.* $(LIB_DIR)/libR*.so*
Note: See TracBrowser for help on using the repository browser.