added 'samples' directory for samples and tests
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1202 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
63
samples/Makefile
Normal file
63
samples/Makefile
Normal file
@@ -0,0 +1,63 @@
|
||||
include Makefile.o.dep
|
||||
|
||||
name=mormsample
|
||||
|
||||
ifndef GLOBAL_WORKING_DIR
|
||||
GLOBAL_WORKING_DIR := $(shell pwd)/../..
|
||||
endif
|
||||
|
||||
|
||||
CXX = g++7
|
||||
#CXX = clang++
|
||||
|
||||
# -fsanitize=address
|
||||
# -Wl,-rpath=/usr/local/lib/gcc5 or just compile with -static-libstdc++
|
||||
|
||||
CXXFLAGS = -Wl,-rpath=/usr/local/lib/gcc7 -Wfatal-errors -fPIC -Wall -pedantic -O0 -g3 -gdwarf-2 -pthread -std=c++17 -I/usr/local/include -I$(GLOBAL_WORKING_DIR)/pikotools -I$(GLOBAL_WORKING_DIR)/morm/src
|
||||
LDFLAGS = -L/usr/local/lib
|
||||
|
||||
|
||||
export CXX
|
||||
export CXXFLAGS
|
||||
export LDFLAGS
|
||||
export GLOBAL_WORKING_DIR
|
||||
|
||||
|
||||
current_path := $(shell pwd)
|
||||
global_relative_working_dir := $(shell relative_path $(current_path) $(GLOBAL_WORKING_DIR))
|
||||
|
||||
|
||||
|
||||
all: morm $(name)
|
||||
|
||||
|
||||
$(name): $(o)
|
||||
$(CXX) -o $(name) $(CXXFLAGS) $(LDFLAGS) $(o) $(GLOBAL_WORKING_DIR)/morm/src/morm.a $(GLOBAL_WORKING_DIR)/pikotools/log/log.a $(GLOBAL_WORKING_DIR)/pikotools/space/space.a $(GLOBAL_WORKING_DIR)/pikotools/mainspaceparser/mainspaceparser.a $(GLOBAL_WORKING_DIR)/pikotools/date/date.a $(GLOBAL_WORKING_DIR)/pikotools/convert/convert.a $(GLOBAL_WORKING_DIR)/pikotools/utf8/utf8.a $(LDFLAGS) -lpq -lpthread
|
||||
|
||||
|
||||
.PHONY: morm
|
||||
|
||||
|
||||
morm:
|
||||
@cd $(GLOBAL_WORKING_DIR)/morm/src ; $(MAKE) -e
|
||||
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
|
||||
|
||||
depend:
|
||||
makedepend -Y. -I$(global_relative_working_dir)/pikotools -I$(global_relative_working_dir)/morm/src -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
|
||||
|
||||
|
||||
clean:
|
||||
@cd $(GLOBAL_WORKING_DIR)/morm/src ; $(MAKE) -e clean
|
||||
rm -f *.o
|
||||
rm -f $(name)
|
||||
|
||||
|
||||
|
||||
|
||||
include Makefile.dep
|
Reference in New Issue
Block a user