1 |
gcodispo |
1.1 |
#
|
2 |
|
|
# Make file valid only on linux
|
3 |
|
|
#
|
4 |
|
|
|
5 |
|
|
#####################################
|
6 |
|
|
|
7 |
|
|
# find out in which directory we are
|
8 |
swakef |
1.4 |
BOSSDIR = ..
|
9 |
gcodispo |
1.1 |
SRCDIR = .
|
10 |
yzhang |
1.2 |
INCLUDEDIR = ../include
|
11 |
swakef |
1.4 |
COREINCLUDEDIR = $(BOSSDIR)/BossCore/include
|
12 |
|
|
CLIENTINCDIR = $(BOSSDIR)/BossClient/include
|
13 |
|
|
LIBDIR = $(BOSSDIR)/lib
|
14 |
|
|
BINDIR = $(BOSSDIR)/bin
|
15 |
|
|
OSUDIR = $(BOSSDIR)/OSUtils
|
16 |
gcodispo |
1.1 |
OSUINC = $(OSUDIR)/include
|
17 |
swakef |
1.4 |
CLADDIR = $(BOSSDIR)/ClassAdLite
|
18 |
gcodispo |
1.1 |
CLADINC = $(CLADDIR)/include
|
19 |
swakef |
1.4 |
DBDIR = $(BOSSDIR)/SirDB
|
20 |
yzhang |
1.3 |
DBINC = $(DBDIR)/include
|
21 |
gcodispo |
1.1 |
|
22 |
swakef |
1.4 |
CLIENTDIR = $(BOSSDIR)/BossClient
|
23 |
yzhang |
1.2 |
CLIENTINC = $(CLIENTDIR)/include
|
24 |
|
|
|
25 |
|
|
MLDIR = @monalisa_dir@
|
26 |
|
|
MLINC = @monalisa_inc@
|
27 |
|
|
MLLIB = @monalisa_lib@
|
28 |
|
|
|
29 |
gcodispo |
1.1 |
XMLINC = `xml2-config --cflags`
|
30 |
|
|
XMLLIB = `xml2-config --libs`
|
31 |
|
|
XSLTINC = `xslt-config --cflags`
|
32 |
yzhang |
1.2 |
XSLTLIB = `xslt-config --libs`
|
33 |
gcodispo |
1.1 |
|
34 |
|
|
PYTHONINC:=`python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()'`
|
35 |
|
|
|
36 |
yzhang |
1.2 |
|
37 |
gcodispo |
1.1 |
# defines the include path
|
38 |
gcodispo |
1.5 |
INCLUDES += -DLOGL1 -DLOGL2 -DLOGL3 -I$(CLIENTINCDIR) -I$(COREINCLUDEDIR) -I$(OSUINC) -I$(CLADINC) -I$(DBINC) -I$(CLIENTINC) -I$(MLINC) $(XMLINC) $(XSLTINC) -I$(DBINC)
|
39 |
gcodispo |
1.1 |
|
40 |
|
|
# define the compiler
|
41 |
yzhang |
1.2 |
CXX = c++
|
42 |
gcodispo |
1.1 |
AR = ar
|
43 |
|
|
|
44 |
|
|
# define compilation flags to
|
45 |
yzhang |
1.3 |
CXXFLAGS = -Wall $(INCLUDES) -rdynamic -export-dynamic
|
46 |
gcodispo |
1.1 |
|
47 |
|
|
#define the program to use to make archive library (c++ does it)
|
48 |
|
|
MKARLIB = $(AR) r
|
49 |
|
|
|
50 |
|
|
# define the program used to build dependencies (again gnu c++ -M(M) -MG)
|
51 |
|
|
DEPEND = $(CXX) -M -MG
|
52 |
|
|
|
53 |
|
|
# define the loader, and the loading flags
|
54 |
gcodispo |
1.5 |
LD = $(CXX) -shared -fPIC
|
55 |
gcodispo |
1.1 |
|
56 |
yzhang |
1.3 |
# define library search paths
|
57 |
|
|
LIB_DIR = -L$(LIBDIR) -L$(MLLIB) -rdynamic -export-dynamic
|
58 |
gcodispo |
1.1 |
|
59 |
|
|
# define the library to build
|
60 |
yzhang |
1.2 |
#COMMLIB = $(LIBDIR)/libBossComm.a
|
61 |
gcodispo |
1.1 |
|
62 |
|
|
# define sources to be all file with extention .cc
|
63 |
|
|
|
64 |
yzhang |
1.2 |
BASEOBJS:= $(wildcard $(CLIENTDIR)/src/*.o)
|
65 |
gcodispo |
1.1 |
|
66 |
yzhang |
1.2 |
# executables
|
67 |
|
|
TARGET = BossUserSession
|
68 |
gcodispo |
1.1 |
|
69 |
|
|
#####################################
|
70 |
|
|
|
71 |
|
|
# define our libraries
|
72 |
|
|
|
73 |
|
|
# build the option for the loader (essentially the list of libraries)
|
74 |
yzhang |
1.3 |
LDFLAGS = $(LIBDIR)/libBossBase.a $(LIBDIR)/libBossBase.a -lClassAdLite -lOSUtils $(XMLLIB) $(XSLTLIB) -lapmoncpp
|
75 |
yzhang |
1.2 |
|
76 |
gcodispo |
1.1 |
#________________________________________________________________
|
77 |
|
|
# R U L E S
|
78 |
|
|
#________________________________________________________________
|
79 |
|
|
|
80 |
yzhang |
1.2 |
|
81 |
|
|
# build static libraries out of all objects
|
82 |
|
|
|
83 |
|
|
# compile a .cc
|
84 |
|
|
|
85 |
|
|
#---------------------------------------
|
86 |
|
|
|
87 |
|
|
# creates dependencies file
|
88 |
|
|
|
89 |
|
|
# include dependences
|
90 |
|
|
|
91 |
|
|
#include $(SOURCES:.cc=.d)
|
92 |
|
|
|
93 |
|
|
######
|
94 |
|
|
|
95 |
gcodispo |
1.1 |
# default is build shared library for a particular package
|
96 |
|
|
all: build
|
97 |
|
|
|
98 |
yzhang |
1.2 |
#requires swig version 1.3.x or higher (tested with 1.3.19 and 1.3.21)
|
99 |
|
|
#to be run before release - removes swig requirement from users machine
|
100 |
gcodispo |
1.1 |
generate:
|
101 |
yzhang |
1.2 |
swig -python -c++ -I$(INCLUDES) $(TARGET).i
|
102 |
gcodispo |
1.1 |
|
103 |
yzhang |
1.2 |
#compiles C++ and python bindings
|
104 |
gcodispo |
1.1 |
build:
|
105 |
yzhang |
1.3 |
${CXX} $(CXXFLAGS) -c $(TARGET)_wrap.cxx -I$(PYTHONINC)
|
106 |
gcodispo |
1.5 |
${LD} $(BASEOBJS) $(LDFLAGS) $(LIB_DIR) $(TARGET)_wrap.o -o _$(TARGET).so
|
107 |
yzhang |
1.2 |
rm -f $(TARGET)_wrap.o
|
108 |
|
|
|
109 |
|
|
#do both - only use if swig v1.3.x is installed
|
110 |
swakef |
1.4 |
full: @swig_generate@ build
|
111 |
gcodispo |
1.1 |
|
112 |
|
|
|
113 |
|
|
# clean file left by emacs...
|
114 |
|
|
rmold:
|
115 |
|
|
@ rm -f *~
|
116 |
|
|
|
117 |
yzhang |
1.2 |
clean: rmold
|
118 |
yzhang |
1.3 |
rm -f *.o; rm -f *.d; rm -f *.so; rm -f $(TARGET).pyc
|
119 |
gcodispo |
1.1 |
|
120 |
yzhang |
1.3 |
veryclean: clean
|
121 |
|
|
rm -f $(TARGET).py* $(TARGET)_wrap.cxx
|
122 |
gcodispo |
1.1 |
|