Geant4 Cross Reference |
>> 1 # $Id: GNUmakefile,v 1.13 2005/03/17 17:20:19 daquinog Exp $ 1 # -------------------------------------------- 2 # -------------------------------------------------------------- 2 # GNUmakefile for examples module. Gabriele C 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. 3 # -------------------------------------------- 4 # -------------------------------------------------------------- 4 << 5 # >> 6 # The variable PI_BASE_DIR has to be setup. See ../README. >> 7 # 5 8 6 name := exampleB03 9 name := exampleB03 7 G4TARGET := $(name) 10 G4TARGET := $(name) 8 G4EXLIB := true 11 G4EXLIB := true 9 12 10 ifndef G4INSTALL 13 ifndef G4INSTALL 11 G4INSTALL = ../../../.. << 14 G4INSTALL = ../../.. 12 endif 15 endif 13 16 14 .PHONY: all << 17 include $(G4INSTALL)/config/architecture.gmk 15 all: lib bin << 18 >> 19 SWIGINC = include/B03App.i >> 20 SWIGCC = src/B03App_wrap.cc >> 21 SWIGD = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/B03App_wrap.d >> 22 objectfilesWrapper = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/B03App_wrap.o >> 23 SWIGSO = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/_B03App.so >> 24 >> 25 moduleName = B03App >> 26 >> 27 MYLIBS = $(subst -l$(name),,$(LDLIBS)) >> 28 >> 29 SWIG = ${SWIG_BASE_DIR}/bin/swig-${SWIGVERSION} >> 30 #SWIG = ${SWIG_BASE_DIR}/bin/swig >> 31 >> 32 .PHONY: clean_all all >> 33 all: $(SWIGD) $(SWIGCC) lib $(SWIGSO) bin >> 34 >> 35 CPPFLAGS += -I${PYTHON_INCLUDE_DIR} >> 36 CXXFLAGS += -w >> 37 >> 38 LDFLAGS += \ >> 39 -L${PYTHON_LIB_DIR} \ >> 40 -llcg_AIDA_AnalysisFactory \ >> 41 -llcg_PluginManager \ >> 42 -llcg_SealBase \ >> 43 -llcg_AIDA_Plugin \ >> 44 -L/lib \ >> 45 -lnsl -ldl -lreadline /lib/libtermcap.so.2 -lieee -lpthread -lutil -lexampleB03 -lpython$(PYTHONVERSION) 16 46 17 include $(G4INSTALL)/config/binmake.gmk 47 include $(G4INSTALL)/config/binmake.gmk >> 48 >> 49 ifdef G4ANALYSIS_USE >> 50 CPPFLAGS += `aida-config --include` >> 51 LDFLAGS += `aida-config --lib` >> 52 endif >> 53 >> 54 $(SWIGSO): $(objectfilesWrapper) >> 55 @echo Creating shared library: $@ >> 56 $(CXX) -Wl,-soname,$(@F) -shared $(LDFLAGS) $(objectfilesWrapper) $(MYLIBS) -lc -o $(SWIGSO) >> 57 >> 58 src/%_wrap.cc: include/%.i >> 59 $(SWIG) -python -c++ -shadow -no_default $(SWIGFLAGS) \ >> 60 -o $@ $< >> 61 @mv src/$(moduleName).py ./ >> 62 >> 63 ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name): >> 64 @mkdir ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name) >> 65 >> 66 >> 67 clean_all: clean >> 68 @rm -f B03App.pyc >> 69 @rm B03App.py >> 70 @rm src/B03App_wrap.cc >> 71 >> 72 >> 73 #libdir = $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name) >> 74 #objectfiles = $(shell /bin/ls $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/*.o) >> 75 #_B03App.so: >> 76 # @echo Creating shared library: $(libdir)/$@ >> 77 # $(CXX) -Wl,-soname,$(@F) -shared $(LDFLAGS) $(LDLIBS) -L$(libdir) $(objectfiles) -o $(libdir)/$@ >> 78 18 79