# standalone tests generation makefile: # creates an executable from each .cpp file in the # src directory: PROJECT_DIR=.. #ifeq ($(PLATFORM),Linux) CXX=g++ LD=g++ #else #CXX=c:/Dev-Cpp/bin/mingw32-g++.exe #LD=c:/Dev-Cpp/bin/mingw32-g++.exe #endif #ifeq ($(PLATFORM),Linux) INCDIR= -I$(PROJECT_DIR)/inc -I`root-config --incdir` #else #INCDIR= -I$(PROJECT_DIR)/libusb-win32-device-bin-0.1.10.1/include \ #-I$(PROJECT_DIR)/interface \ #-I$(PROJECT_DIR)/include #endif #ifeq ($(PLATFORM),Linux) CXXFLAGS=-c -Wall -ansi -g #else #CXXFLAGS=-c -Wall -ansi -g -DWin32 #endif #ifeq ($(PLATFORM),Linux) LINKSEARCH=-L$(PROJECT_DIR)/lib #else #LINKSEARCH=-L$(PROJECT_DIR)/lib -L$(PROJECT_DIR)/libusb-win32-device-bin-0.1.10.1/lib/gcc #endif LDFLAGS+= #LINK+= LIBS=-lMAPSTRACKS `root-config --glibs` -lThread -lHistPainter -lGeom -lRGL -lGed -lGeomBuilder -lFTGL #-ldl \ #-lCore -lCint -lRint -lMatrix -lGpad -lGraf -lGed -lGui -lHist -lHistPainter -lTree \ #-lfreeimage # file locations: EXEDIR=exe SRCDIR=src OBJDIR=obj LIBDIR=lib OBJ_EXT=o # populate variables: SRC=$(wildcard src/*.cpp) OBJ=$(subst $(SRCDIR), $(OBJDIR),$(subst cpp,$(OBJ_EXT),$(SRC))) # deduce the targets: TARGETS=$(subst .cpp,,$(subst $(SRCDIR),$(EXEDIR),$(SRC))) all:$(TARGETS) $(OBJ) $(OBJDIR)/%.$(OBJ_EXT):$(SRCDIR)/%.cpp $(CXX) $(CXXFLAGS) $(INCDIR) $< -o $@ $(EXEDIR)/%:$(OBJDIR)/%.$(OBJ_EXT) $(LD) -o $@ $(LDFLAGS) $< $(LINKSEARCH) $(LIBS) vars: @echo "Project Dir: " $(PROJECT_DIR) @echo "INCDIR: " $(INCDIR) @echo "LINKSEARCH: " $(LINKSEARCH) @echo "LIBS: " $(LIBS) @echo "Source files: " $(SRC) @echo "Object files: " $(OBJ) @echo "Executables: " $(TARGETS) clean: rm -f $(OBJ) $(TARGETS) force: @make clean @make