From 2190fae789b5eeaceadb6f50c8621057f5497a89 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 18 Mar 2016 09:22:13 +0000 Subject: [PATCH] changed: using relative paths calculated with relative_path now git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1032 e52654a7-88a9-db11-a3e9-0013d4bc506e --- src/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 94280c7..0d0d028 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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