2009-11-13 22:10:06 +01:00
|
|
|
include Makefile.o.dep
|
|
|
|
|
2012-01-12 03:32:04 +01:00
|
|
|
libname=ezc.a
|
2008-12-30 02:21:30 +01:00
|
|
|
|
2016-03-18 10:22:13 +01:00
|
|
|
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))
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-12 03:32:04 +01:00
|
|
|
all: $(libname)
|
2008-12-30 02:21:30 +01:00
|
|
|
|
2012-01-12 03:32:04 +01:00
|
|
|
$(libname): $(o)
|
|
|
|
ar rcs $(libname) $(o)
|
2008-12-30 02:21:30 +01:00
|
|
|
|
2013-10-16 01:48:06 +02:00
|
|
|
|
2008-12-30 02:21:30 +01:00
|
|
|
|
2016-03-18 10:22:13 +01:00
|
|
|
|
2011-06-06 22:36:19 +02:00
|
|
|
%.o: %.cpp
|
2018-11-23 19:33:17 +01:00
|
|
|
$(CXX) -c $(CXXFLAGS) -I$(GLOBAL_WORKING_DIR)/pikotools $<
|
2008-12-30 02:21:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
depend:
|
2014-10-11 21:56:48 +02:00
|
|
|
# !! IMPROVE ME
|
2016-03-18 10:22:13 +01:00
|
|
|
# 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
|
2009-11-13 22:10:06 +01:00
|
|
|
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
|
2008-12-30 02:21:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
2012-01-12 03:32:04 +01:00
|
|
|
rm -f $(libname)
|
2008-12-30 02:21:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
include Makefile.dep
|