changed: using relative paths calculated with relative_path now

git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1032 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2016-03-18 09:22:13 +00:00
parent 0e99ded5b8
commit 2190fae789
1 changed files with 14 additions and 4 deletions

View File

@ -2,6 +2,15 @@ include Makefile.o.dep
libname=ezc.a
ifndef GLOBAL_WORKING_DIR
GLOBAL_WORKING_DIR := $(shell pwd)/../..
endif
current_path := $(shell pwd)
global_relative_working_dir := $(shell relative_path $(current_path) $(GLOBAL_WORKING_DIR))
all: $(libname)
$(libname): $(o)
@ -10,20 +19,21 @@ $(libname): $(o)
additionalinclude =
ifdef EZC_USE_WINIX_LOGGER
additionalinclude = -I../../winix -I../../ezc/src
additionalinclude = $(EZC_ADDITIONAL_INCLUDE)
endif
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) -I../../pikotools $(additionalinclude) $<
$(CXX) -c $(CXXFLAGS) -I$(GLOBAL_WORKING_DIR)/pikotools $(additionalinclude) $<
depend:
# we do not use $(additionalinclude) here because the dependencies would be added to the repository
# and messes other projects
# !! IMPROVE ME
# as Ezc is a different project we rather shoudn't use '-I../../pikotools' here?
makedepend -Y. -I../../pikotools -f- *.cpp > Makefile.dep
# as Ezc is a different project we rather shoudn't use '-I$(global_relative_working_dir)/pikotools' here?
makedepend -Y. -I$(global_relative_working_dir)/pikotools -f- *.cpp > Makefile.dep
echo -n "o = " > Makefile.o.dep
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep