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