Blame | Last modification | View Log | RSS feed
# Make variables ----------------------------------------------------
# ROOT include and libraries
ROOTINC=$(shell root-config --incdir )
ROOTLIB=$(shell root-config --libs )
LIBS1=$(shell root-config --cflags --glibs )
# Includes, 32 vs. 64 bit type, libraries
INC=-I. -I$(ROOTINC)
OSTYPE=none
LIBS=$(ROOTLIB) -L./ -lm
# Source and debug prefixes
SRC = .
DBG =
# CAMAC DAQ library variables
OBJ_FILES = wusbxx_dll.o libxxusb.o
LIBFILE = libdaqusb.a
# Specific variables for the main program
TARGET = windowed_test
DAQFILE = $(SRC)/daqusb.C
FILES = $(SRC)/daqusb.C $(SRC)/windowed_test.C $(SRC)/daqscope.C
HEADER = daq.h workstation.h root_include.h windowed_test.h
CAMLIB = $(LIBFILE)
SHLIB = $(LIBFILE) libvxi11.a
# VXI scope connection variables, Scope DAQ library variables
VXIDIR = ./vxi11_$(OSTYPE)
#VXI_FILES = $(VXIDIR)/vxi11_user.o $(VXIDIR)/vxi11.h $(VXIDIR)/vxi11_clnt.c $(VXIDIR)/vxi11_xdr.c
VXI_OBJECT = $(VXIDIR)/vxi11_user.o $(VXIDIR)/vxi11_clnt.o $(VXIDIR)/vxi11_xdr.o
# -----------------------------------------------------------------------------
# Base rules ------------------------------------------------------------------
# Make the main program and libraries
all: $(TARGET) libdaqusb.so libvxi11.so
# Rules for making the main program
$(TARGET): $(FILES) workstation.h daq.h library $(SHLIB)
@echo "Generating dictionary Dict.C..."
rootcint -f GuiDict.C -c $(INC) $(CPPFLAGS) windowed_test.h GuiLinkDef.h
$(CXX) $(INC) -fPIC -g -Wall $(FILES) GuiDict.C $(CPPFLAGS) $(VXI_OBJECT) -o $(TARGET) $(SHLIB) $(LIBS1) -lstdc++ -lSpectrum
# -----------------------------------------------------------------------------
# CAMAC DAQ library rules -----------------------------------------------------
# Rules for making CAMAC DAQ library source files (wusbxx_dll and libxxusb)
library: $(OBJ_FILES)
wusbxx_dll.o:wusbxx_dll.c wusbxx_dll.h
libxxusb.o: libxxusb.cpp libxxusb.h
.cc.o:
$(CXX) -fPIC -c $<
ar r $(LIBFILE) $@
.cpp.o:
$(CXX) -fPIC -c $<
ar r $(LIBFILE) $@
.c.o:
$(CXX) -fPIC -c $<
ar r $(LIBFILE) $@
# Rules for recreating the CAMAC DAQ libraries even if they exist (libdaqusb.so/.a)
relib:
rm -f libdaqusb.so libdaqusb.a libvxi11.so libvxi11.a
make libdaqusb.so libvxi11.so
# Rule for making the CAMAC DAQ library (libdaqusb.so)
libdaqusb.so: $(DAQFILE) $(LIBFILE)
@echo "Generating dictionary Dict.C..."
rootcint -f Dict.C -c $(INC) $(CPPFLAGS) $(HEADER) GuiLinkDef.h
$(CXX) $(CPPFLAGS) $(INC) -fPIC -g -Wall $(DAQFILE) Dict.C $(CAMLIB) -shared -o $@
# Rule for making the CAMAC DAQ library (libdaqusb.a)
$(LIBFILE): $(OBJ_FILES)
ar r $@ $^
# -----------------------------------------------------------------------------
# Scope DAQ library rules -----------------------------------------------------
libvxi11.so: libvxi11.a
@echo "Generating dictionary VxiDict.C..."
rootcint -f VxiDict.C -c $(INC) $(CPPFLAGS) daqscope.h GuiLinkDef.h
$(CXX) $(CPPFLAGS) $(INC) -fPIC -g -Wall daqscope.C VxiDict.C -L. libvxi11.a -shared -o $@
libvxi11.a: $(VXI_OBJECT)
ar r $@ $^
# -----------------------------------------------------------------------------
# Clean rule ------------------------------------------------------------------
# Rule for cleaning the installation
clean:
rm -f Dict.C Dict.h GuiDict.C GuiDict.h windowed_test windowed_test_C.d windowed_test_C.so curpos.txt curvolt.txt workstation.h VxiDict.C VxiDict.h daqscope.C daqusb.C start.sh usb.h libxxusb.h libdaqusb.a libdaqusb.so libvxi11.a libvxi11.so *.o finish_sig.txt
# -----------------------------------------------------------------------------