Skip to content

Commit c8023d7

Browse files
undefined-pandahahnjo
authored andcommitted
Added parameters for dict folder, write folder and read folder. ROOT files and JSON files are now written directly in designated folders.
DICT_DIR, WRITE_DIR and READ_DIR always end with '/', so that inner Makefiles can be run individually. Adjusted DICT_DIR, WRITE_DIR and READ_DIR to always end with '/', so that inner Makefiles can be run individually
1 parent 6da230e commit c8023d7

11 files changed

Lines changed: 25 additions & 27 deletions

File tree

Makefile

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@ ifeq ($(ROOT_EXE),)
33
$(error Could not find root.exe)
44
endif
55

6-
define move_files
7-
mkdir -p $(1)_files && \
8-
find . -name "*.$(1)" -not -path "./$(1)_files/*" -exec mv {} "$(1)_files" \;
9-
endef
10-
11-
ver :=
12-
DICT_DIR := $(shell pwd)/dict/$(ver)/
6+
# directory arguments can be empty -> no sudirectories will be created, everything will be stored directly in those folders
7+
DICT_DIR := $(shell pwd)/dict/$(if $(dict_dir),$(dict_dir)/)
8+
WRITE_DIR := $(shell pwd)/write/$(if $(write_dir),$(write_dir)/)
9+
READ_DIR := $(shell pwd)/read/$(if $(write_dir),$(write_dir)/)$(if $(read_dir),$(read_dir)/)
1310
export DICT_DIR
1411

1512
.PHONY: all
1613
all:
1714
$(MAKE) dict
1815
$(MAKE) write
1916
$(MAKE) read
20-
$(MAKE) store
2117

2218
# This assumes there is no whitespace in any of the paths...
2319
DICT_MAKEFILE_DIR := $(sort $(shell find */ -name Makefile -printf "%h\n"))
@@ -34,15 +30,17 @@ $(DICT_DIR)::
3430

3531
.PHONY: write
3632
write:: $(WRITE_C)
37-
$(WRITE_C)::
38-
@LD_LIBRARY_PATH="$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(or $(DICT_DIR),$(shell dirname $@))" $(ROOT_EXE) -q -l $@
33+
$(WRITE_C):: $(WRITE_DIR)
34+
@LD_LIBRARY_PATH="$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(DICT_DIR)" $(ROOT_EXE) -q -l '$@("$(WRITE_DIR)$(subst /,.,$(shell dirname $@)).root")'
35+
$(WRITE_DIR)::
36+
@mkdir -p $@
37+
$(info Storing root files in: '$@')
3938

4039
.PHONY: read
4140
read:: $(READ_C)
42-
$(READ_C)::
43-
@LD_LIBRARY_PATH="$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(or $(DICT_DIR),$(shell dirname $@))" $(ROOT_EXE) -q -l $@
44-
45-
.PHONY: store
46-
store:
47-
@$(call move_files,root)
48-
@$(call move_files,json)
41+
$(READ_C):: $(READ_DIR)
42+
@LD_LIBRARY_PATH="$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(DICT_DIR)" $(ROOT_EXE) -q -l \
43+
'$@("$(WRITE_DIR)/$(subst /,.,$(shell dirname $@)).root", "$(READ_DIR)$(subst /,.,$(shell dirname $@)).json")'
44+
$(READ_DIR)::
45+
@mkdir -p $@
46+
$(info Storing root files in: '$@')

types/map/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedMap.cxx: NestedMap.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedMap.so: $(DICT_DIR)NestedMap.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedMap.cxx NestedMap_rdict.pcm libNestedMap.so

types/multimap/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedMultimap.cxx: NestedMultimap.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedMultimap.so: $(DICT_DIR)NestedMultimap.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedMultimap.cxx NestedMultimap_rdict.pcm libNestedMultimap.so

types/multiset/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedMultiset.cxx: NestedMultiset.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedMultiset.so: $(DICT_DIR)NestedMultiset.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedMultiset.cxx NestedMultiset_rdict.pcm libNestedMultiset.so

types/set/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedSet.cxx: NestedSet.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedSet.so: $(DICT_DIR)NestedSet.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedSet.cxx NestedSet_rdict.pcm libNestedSet.so

types/unordered_map/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedUnorderedMap.cxx: NestedUnorderedMap.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedUnorderedMap.so: $(DICT_DIR)NestedUnorderedMap.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedUnorderedMap.cxx NestedUnorderedMap_rdict.pcm libNestedUnorderedMap.so

types/unordered_multimap/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedUnorderedMultimap.cxx: NestedUnorderedMultimap.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedUnorderedMultimap.so: $(DICT_DIR)NestedUnorderedMultimap.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedUnorderedMultimap.cxx NestedUnorderedMultimap_rdict.pcm libNestedUnorderedMultimap.so

types/unordered_multiset/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedUnorderedMultiset.cxx: NestedUnorderedMultiset.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedUnorderedMultiset.so: $(DICT_DIR)NestedUnorderedMultiset.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedUnorderedMultiset.cxx NestedUnorderedMultiset_rdict.pcm libNestedUnorderedMultiset.so

types/unordered_set/nested/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)NestedUnorderedSet.cxx: NestedUnorderedSet.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libNestedUnorderedSet.so: $(DICT_DIR)NestedUnorderedSet.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) NestedUnorderedSet.cxx NestedUnorderedSet_rdict.pcm libNestedUnorderedSet.so

types/user/class/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(DICT_DIR)UserClass.cxx: UserClass.hxx LinkDef.h
2020
$(ROOTCLING) -f $@ $^
2121

2222
$(DICT_DIR)libUserClass.so: $(DICT_DIR)UserClass.cxx
23-
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I $$(pwd)
23+
$(CXX) -shared -fPIC -o $@ $^ $(CXXFLAGS) $(LDFLAGS) -I .
2424

2525
clean:
2626
$(RM) UserClass.cxx UserClass_rdict.pcm libUserClass.so

0 commit comments

Comments
 (0)