1
0
Fork 0
mirror of https://github.com/gwm17/Mask.git synced 2024-11-13 05:58:50 -05:00

Added premake to generate makefiles to improve compatibility. Separated detector source code into a subdirectory.

This commit is contained in:
Gordon McCann 2021-08-25 12:05:04 -04:00
parent c5ff59a242
commit 0bafaa3b2e
9 changed files with 38 additions and 43 deletions

2
.gitignore vendored
View File

@ -10,6 +10,8 @@
*.o *.o
*.swp *.swp
.DS_Store .DS_Store
Makefile
*.make
###Keep this file### ###Keep this file###

View File

@ -1,43 +0,0 @@
CC=g++
ROOTGEN=rootcint
CFLAGS=-g -Wall `root-config --cflags`
CPPFLAGS=-I ./include
LDFLAGS=`root-config --glibs`
ROOTINCLDIR=./
INCLDIR=./include
SRCDIR=./src
OBJDIR=./objs
BINDIR=./bin
SRC=$(wildcard $(SRCDIR)/*.cpp)
OBJS=$(SRC:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
DICTOBJ=$(OBJDIR)/kinematics_dict.o
DICTSRC=$(SRCDIR)/kinematics_dict.cxx
DICT_PAGES=$(INCLDIR)/Kinematics.h $(INCLDIR)/LinkDef_Kinematics.h
EXE=$(BINDIR)/mask
CLEANUP=$(EXE) $(OBJS) $(DICTOBJ) $(DICTSRC)
.PHONY: all clean
all: $(EXE) $(TPEXE)
$(EXE): $(DICTOBJ) $(OBJS)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
$(DICTOBJ): $(DICTSRC)
$(CC) $(CFLAGS) $(CPPFLAGS) -I $(ROOTINCLDIR) -c $^ -o $@
mv $(SRCDIR)/*.pcm $(BINDIR)
$(DICTSRC): $(DICT_PAGES)
$(ROOTGEN) -f $@ $^
VPATH= $(SRCDIR):./testplots/
$(OBJDIR)/%.o: %.cpp
$(CC) $(CFLAGS) $(CPPFLAGS) -c $^ -o $@
clean:
$(RM) $(CLEANUP) $(BINDIR)/%.pcm

36
premake5.lua Normal file
View File

@ -0,0 +1,36 @@
workspace "Mask"
configurations {
"Debug",
"Release"
}
project "Mask"
kind "ConsoleApp"
language "C++"
targetdir "bin"
objdir "objs"
cppdialect "C++11"
files {
"src/**.cpp",
"include/**.h",
"src/**.cxx"
}
includedirs {
"include",
"./"
}
buildoptions {
"`root-config --cflags`"
}
linkoptions {
"`root-config --glibs`"
}
prebuildcommands {
"rootcint -f src/kinematics_dict.cxx include/Kinematics.h include/LinkDef_Kinematics.h",
"{MOVE} src/kinematics_dict_rdict.pcm bin/"
}