-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (22 loc) · 888 Bytes
/
Makefile
File metadata and controls
33 lines (22 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SUBDIRS = libs
ROOT_FLAGS := `root-config --cflags --libs`
CFLAGS := -O3 -I/usr/include/root/ -lstdc++ -std=c++11 -g -Wall -Ilibs/include/
LIBS := -Llibs -lboost_program_options -lboost_system -lboost_filesystem -lMyServiceFunctions -lBoostServiceFunctions
CC := g++
CXX_FILES := $(wildcard src/*.cxx)
exec := $(notdir $(CXX_FILES:.cxx=.exe))
includes := $(wildcard include/*.h)
exec_with_incl := $(notdir $(includes:.h=.exe))
exec_without_incl := $(filter-out $(exec_with_incl),$(exec)) # subtract one list from another
all: $(exec_with_incl) $(exec_without_incl)
libs: subdirs
$(exec_with_incl): %.exe: src/%.cxx include/%.h
$(CC) $(CFLAGS) $(ROOT_FLAGS) $(LIBS) -Iinclude/ $< -o $@
$(exec_without_incl): %.exe: src/%.cxx
$(CC) $(CFLAGS) $(ROOT_FLAGS) $(LIBS) $< -o $@
.PHONY: clean subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
clean:
rm -f *~ *.exe