12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- # defaults
- ifndef DEBUG
- CXXFLAGS ?= -O3 -march=native -fomit-frame-pointer -pipe -DDEBUG
- else
- CXXFLAGS += -ggdb3
- endif
- #LDFLAGS ?= -Wl,-O1
- LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
- STRIP ?= strip --strip-unneeded -R .comment
- # root-dependant stuff
- ROOTCFLAGS ?= $(shell root-config --cflags)
- CXXFLAGS += -Wall -pipe -D_FILE_OFFSET_BITS=64 $(ROOTCFLAGS) -fvisibility-inlines-hidden
- ROOTLIBS = $(shell root-config --libs) -lEG -lpythia6 -lEGPythia6
- DEPFLAGS = -isystem $(shell root-config --incdir)
- SRCS = pylam.cpp
- OBJS = $(SRCS:.cpp=.o)
- DEPS = $(SRCS:.cpp=.d)
- ##### RULES #####
- .PHONY: all clean deps distclean tags
- all: pylam
- deps: $(DEPS)
- %.d: %.cpp
- $(CXX) $(DEPFLAGS) -MM -MG $< > $@
- ### Binaries rules
- pylam: $(DEPS) $(OBJS) Makefile
- $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(ROOTLIBS) -o $@
- ifndef DEBUG
- $(STRIP) $@
- endif
- # misc and cleanup
- tags:
- ctags $(SRCS)
- clean:
- rm -f $(OBJS) $(DEPS)
- distclean: clean
- rm -f $(BINS) tags
- # on distclean per-file deps will be removed anyway
- ifneq ($(MAKECMDGOALS),clean)
- ifneq ($(MAKECMDGOALS),distclean)
- -include $(DEPS)
- endif
- endif
|