forked from beltoforion/muparserx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (64 loc) · 2.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
CC = g++ -std=c++11 -O3 -Wall -pedantic
CFLAGS = -O3 -Wall -pedantic -ffast-math -fomit-frame-pointer
#CC = clang++
#CFLAGS = `llvm-config --ldflags` -O3 -Wall -pedantic -std=c++11
# debug version
#CFLAGS = -Wall -ggdb
# release version:
PATH_BIN = ./bin
########################################################################################################
# muParser library sources
PATH_LIB = parser
PATH_OBJ = obj
LIB_SRC = mpError.cpp mpRPN.cpp mpICallback.cpp mpIValReader.cpp mpParserBase.cpp mpTokenReader.cpp\
mpVariable.cpp mpIOprt.cpp mpIValue.cpp mpParser.cpp mpValReader.cpp mpFuncStr.cpp\
mpFuncCommon.cpp mpOprtPostfixCommon.cpp mpFuncNonCmplx.cpp mpFuncCmplx.cpp mpIToken.cpp mpOprtCmplx.cpp \
mpOprtNonCmplx.cpp mpOprtBinCommon.cpp mpOprtBinAssign.cpp mpOprtMatrix.cpp\
mpIPackage.cpp mpPackageCommon.cpp mpPackageStr.cpp mpPackageCmplx.cpp mpPackageNonCmplx.cpp\
mpPackageMatrix.cpp mpPackageUnit.cpp mpIfThenElse.cpp mpValueCache.cpp mpValue.cpp mpTest.cpp\
mpScriptTokens.cpp mpFuncMatrix.cpp mpOprtIndex.cpp mpParserMessageProvider.cpp
LIB_OBJ = ${LIB_SRC:.cpp=.o}
NAME_LIB = libmuparserx.a
########################################################################################################
# example application
PATH_SAMPLE = ./sample
all: example
new: clean example
$(NAME_LIB): $(LIB_OBJ:%.o=$(PATH_OBJ)/%.o)
@echo ""
@echo "#########################################################"
@echo "# #"
@echo "# Building libmuparserX #"
@echo "# #"
@echo "#########################################################"
@echo ""
ar ru $(NAME_LIB) $(LIB_OBJ:%.o=$(PATH_OBJ)/%.o)
ranlib $(NAME_LIB)
mv $(NAME_LIB) bin/
$(LIB_OBJ:%.o=$(PATH_OBJ)/%.o):
$(CC) $(CFLAGS) -c $(subst $(PATH_OBJ),$(PATH_LIB),${@:.o=.cpp}) -o $@
example: $(NAME_LIB)
@echo ""
@echo "#########################################################"
@echo "# #"
@echo "# Building sample #"
@echo "# #"
@echo "#########################################################"
@echo ""
$(CC) $(CFLAGS) -I$(PATH_LIB) -L$(PATH_BIN) -o $(PATH_BIN)/$@ $(PATH_SAMPLE)/example.cpp $(PATH_SAMPLE)/timer.cpp -lmuparserx -lm
clean:
#@clear
@echo "########################################################"
@echo "# #"
@echo "# Cleaning up #"
@echo "# #"
@echo "########################################################"
@echo ""
rm -rf *.o
rm -rf *~
rm -rf libmuparserx.a
rm -rf $(PATH_OBJ)/*
rm -rf $(PATH_BIN)/*
new:
$(MAKE) clean
$(MAKE) all