From 8d446b60a6ddef883b93149dc844e4c83b93613d Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 18 Mar 2016 09:25:47 +0000 Subject: [PATCH] changed: using relative paths calculated with relative_path now git-svn-id: svn://ttmath.org/publicrep/tito/trunk@1033 e52654a7-88a9-db11-a3e9-0013d4bc506e --- src/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index cb4f7f9..2f111dc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,18 +2,28 @@ include Makefile.o.dep libname=tito.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) $(AR) rcs $(libname) $(o) + %.o: %.cpp - $(CXX) -c $(CXXFLAGS) -I../../pikotools $< + $(CXX) -c $(CXXFLAGS) -I$(GLOBAL_WORKING_DIR)/pikotools $< depend: - makedepend -Y. -I../../pikotools -f- *.cpp > Makefile.dep + 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