Skip to content

Commit

Permalink
Merge pull request #102 from Negusbuk/master
Browse files Browse the repository at this point in the history
cleanup in makefiles and ROOT5/6 usage
  • Loading branch information
Negusbuk authored Sep 5, 2016
2 parents c338811 + 807fc4f commit a832373
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 8 deletions.
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CONFIGDEFINES=""
ROOTCFLAGS=`root-config --cflags`
ROOTLIBS=`root-config --libs`
ROOTGLIBS=`root-config --glibs`
ROOTMAJOR=`root-config --version | cut -d . -f 1`

while test $# -gt 0; do
case $1 in
Expand Down Expand Up @@ -118,7 +119,7 @@ else
echo build with ASSEMBLY support
fi

SED_VARIABLES="BASEPATH ARCHITECTURE KERNELMAJOR KERNELMINOR QMAKE CXX CC LD NODEFO NOTHERMAL NOASSEMBLY APPLICATIONVERSIONSTR USEFAKEDEVICES WITHTWITTERSUPPORT SOFLAGS CONFIGDEFINES QWTDEFINES QWTINCLUDES QWTLIBS ROOTCFLAGS ROOTLIBS ROOTGLIBS"
SED_VARIABLES="BASEPATH ARCHITECTURE KERNELMAJOR KERNELMINOR QMAKE CXX CC LD NODEFO NOTHERMAL NOASSEMBLY APPLICATIONVERSIONSTR USEFAKEDEVICES WITHTWITTERSUPPORT SOFLAGS CONFIGDEFINES QWTDEFINES QWTINCLUDES QWTLIBS ROOTCFLAGS ROOTLIBS ROOTGLIBS ROOTMAJOR"

echo "#!/bin/sh
dest=\`basename \$1 .in\`
Expand Down
2 changes: 1 addition & 1 deletion thermo/microDAQ/microDAQ.pro.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LIBS += -L@basepath@/devices/lib -lTkModLabHuber
LIBS += -L@basepath@/devices/lib -lTkModLabArduino
LIBS += -L@basepath@/devices/lib -lTkModLabCori
LIBS += -L@basepath@/common -lCommon
LIBS += -lcurl -L@basepath@/external/twitcurl -ltwitcurl
LIBS += -L@basepath@/external/twitcurl -ltwitcurl -lcurl
LIBS += @qwtlibs@

QMAKE = @qmake@
Expand Down
2 changes: 1 addition & 1 deletion thermo/thermoDAQ/thermoDAQ.pro.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIBS += -L@basepath@/devices/lib -lTkModLabHameg
LIBS += -L@basepath@/devices/lib -lTkModLabPfeiffer
LIBS += -L@basepath@/devices/lib -lTkModLabHuber
LIBS += -L@basepath@/common -lCommon
LIBS += -lcurl -L@basepath@/external/twitcurl -ltwitcurl
LIBS += -L@basepath@/external/twitcurl -ltwitcurl -lcurl
LIBS += @qwtlibs@

QMAKE = @qmake@
Expand Down
2 changes: 2 additions & 0 deletions tkmodlabenv.csh.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ setenv DYLD_LIBRARY_PATH "@basepath@/tools/TkModLabRoot:$DYLD_LIBRARY_PATH"
setenv DYLD_LIBRARY_PATH "@basepath@/common:$DYLD_LIBRARY_PATH"
setenv DYLD_LIBRARY_PATH "@basepath@/defo/defoCommon:$DYLD_LIBRARY_PATH"
setenv DYLD_LIBRARY_PATH "@basepath@/assembly/assemblyCommon:$DYLD_LIBRARY_PATH"

setenv PKG_CONFIG_PATH "/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
2 changes: 2 additions & 0 deletions tkmodlabenv.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export DYLD_LIBRARY_PATH="@basepath@/tools/TkModLabRoot:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="@basepath@/common:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="@basepath@/defo/defoCommon:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="@basepath@/assembly/assemblyCommon:$DYLD_LIBRARY_PATH"

export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
3 changes: 2 additions & 1 deletion tools/TkModLabRoot/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.o
TkModLabRootDict*
*Dict.*
*.d
*.pcm
libTkModLabRoot.*

33 changes: 29 additions & 4 deletions tools/TkModLabRoot/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ ARCHITECTURE := $(shell uname)
ROOTCFLAGS := $(shell root-config --cflags)
ROOTLIBS := $(shell root-config --libs)
ROOTGLIBS := $(shell root-config --glibs)
ROOTMAJOR := $(shell root-config --version | cut -d . -f 1)

ifeq ($(ROOTMAJOR),5)
OBJECTS := $(addsuffix .o,$(MODULES)) $(TARGET)5Dict.o
endif

ifeq ($(ROOTMAJOR),6)
OBJECTS := $(addsuffix .o,$(MODULES)) $(TARGET)6Dict.o
endif

# c-compiler
CC = gcc
Expand All @@ -46,23 +55,38 @@ endif

CXXFLAGS += $(ROOTCFLAGS)

RLIBMAP := rlibmap
RLIBDEP := libSmatrix.so libGraf.so
RML := $(addprefix -rml ,$(RLIBDEP))
RML := $(addprefix -rml ,$(RLIBDEP)) $(addprefix -rml ,lib$(TARGET).so)

ELIBS := $(BASEPATH)/external/ddierckx/*.o

ALLDEPEND = $(addsuffix .d,$(MODULES))
EXISTDEPEND = $(shell find . -name \*.d -type f -print)

ifeq ($(ROOTMAJOR),5)
all: depend lib$(TARGET).so lib$(TARGET).rootmap
endif

ifeq ($(ROOTMAJOR),6)
all: depend lib$(TARGET).so
endif

lib$(TARGET).so: $(addsuffix .o,$(MODULES)) $(TARGET)Dict.o
lib$(TARGET).so: $(OBJECTS)
@echo "Linking shared library $@"
@$(LD) $(SOFLAGS) $^ -o $@ $(ELIBS) -lgfortran

$(TARGET)Dict.cc: $(addsuffix .h,$(MODULES)) LinkDef.h
lib$(TARGET).rootmap: lib$(TARGET).so LinkDef.h
@echo "Creating library rootmap $@"
@$(RLIBMAP) -f -o $@ -d lib$(TARGET).so $(RLIBDEP) -c LinkDef.h

$(TARGET)5Dict.cc: $(addsuffix .h,$(MODULES)) LinkDef.h
@echo "Generating dictionary $@"
@rootcint -f $(TARGET)5Dict.cc -c $(CPPFLAGS) -p $(addsuffix .h,$(MODULES)) LinkDef.h

$(TARGET)6Dict.cc: $(addsuffix .h,$(MODULES)) LinkDef.h
@echo "Generating dictionary $@"
rootcling -f $(TARGET)Dict.cc -rmf lib$(TARGET).rootmap $(RML) $(addsuffix .h,$(MODULES)) LinkDef.h
@rootcling -f $(TARGET)6Dict.cc -rmf lib$(TARGET).rootmap $(RML) $(addsuffix .h,$(MODULES)) LinkDef.h

%.d: %.cc
@echo Making dependency for file $< ...
Expand All @@ -80,6 +104,7 @@ depend: $(ALLDEPEND)
clean:
@rm -f $(addsuffix .o,$(MODULES))
@rm -f *Dict.*
@rm -f *Dict_rdict.pcm
@rm -f lib$(TARGET).so
@rm -f lib$(TARGET).rootmap
@rm -f *.d
Expand Down

0 comments on commit a832373

Please sign in to comment.