Makefile 3.65 KB
Newer Older
1
UNAME := $(shell uname)
2 3 4
ifeq ($(shell uname -o 2>/dev/null),Msys)
	OS := MINGW
endif
Ogier Maitre's avatar
Ogier Maitre committed
5
EXEC = bin/easea
6
CPPFLAGS += -DUNIX_OS -Ialexyacc/include/ -g  -Wno-deprecated -DDEBUG -DLINE_NUM_EZ_FILE
moh_lo's avatar
moh_lo committed
7 8
LDFLAGS = 

Ogier Maitre's avatar
Ogier Maitre committed
9
OBJ= build/EaseaSym.o build/EaseaParse.o build/EaseaLex.o alexyacc/libalex.a build/EaseaYTools.o boost/program_options.a libeasea/libeasea.a
10

11
#ifeq ($(UNAME),Darwin)
Ogier Maitre's avatar
Ogier Maitre committed
12
$(EXEC):build bin $(OBJ)
13
	$(CXX) $(CPPFLAGS) $(LDFLAGS) $(OBJ) -o $@ 
14
ifneq ("$(OS)","")
15 16 17 18 19 20 21 22 23 24
	#
	# Congratulations !  It looks like you compiled EASEA successfully.
	# 
	# You can use easea from this directory by typing :
	#       For example : 
	#      easea.exe examples\weierstrass_std\weierstrass.ez
	# Go to the target directory and type make -f weierstrass.mak
	#
	# Thanks for using EASEA.
	#
Ogier Maitre's avatar
Ogier Maitre committed
25
else
26 27 28
	#
	# Congratulations !  It looks like you compiled EASEA successfully.
	# 
Ogier Maitre's avatar
Ogier Maitre committed
29 30
	# You can now install easea into your system or use it from 
	# its current directory.
31
	#
Ogier Maitre's avatar
Ogier Maitre committed
32 33
	# Installation:
	# To install EASEA into your system, type:
34 35
	#	 ". install.sh ".
	# EASEA will be installed into /usr/local/easea/ directory,
Ogier Maitre's avatar
Ogier Maitre committed
36 37 38 39
	# including, the binary, its libraries and the templates.
	# Finaly, environment variables will be updated (EZ_PATH and PATH),
ifeq ($(UNAME),Darwin)
	# into your .bash_profile file.
40
else
Ogier Maitre's avatar
Ogier Maitre committed
41 42
	# into your .bashrc file.
endif
43
	# 
Ogier Maitre's avatar
Ogier Maitre committed
44 45 46 47 48 49 50 51
	# Local Usage:
	# All EASEA elements will stay in the current directory, 
	# but some environment variables need to be updated into your
ifeq ($(UNAME),Darwin)
	# .bash_profile file (EZ_PATH and). To do so type:
else
	# .bashrc file (EZ_PATH and). To do so type:
endif
52
	#	 ". install.sh local". 
53
	#
54 55
	# Thanks for using EASEA.
	#
56
endif
57 58

# $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so
59
# 	$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
moh_lo's avatar
moh_lo committed
60 61


62
# $(EXEC)_bin:EaseaSym.o EaseaParse.o EaseaLex.o 
63
# 	$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex
maitre's avatar
rc-2  
maitre committed
64 65


66
install:
Ogier Maitre's avatar
Ogier Maitre committed
67 68
	mkdir -p /usr/local/easea/ /usr/local/easea/bin /usr/local/easea/tpl /usr/local/easea/libeasea/include /usr/local/easea/boost /usr/local/easea/easeagrapher/
	cp bin/easea /usr/local/easea/bin/
Ogier Maitre's avatar
Ogier Maitre committed
69 70 71
	cp tpl/* /usr/local/easea/tpl/
	cp libeasea/include/* /usr/local/easea/libeasea/include/
	cp libeasea/libeasea.a /usr/local/easea/libeasea/
Ogier Maitre's avatar
Ogier Maitre committed
72 73
	cp boost/program_options.a /usr/local/easea/boost
	cp -r boost/boost/ /usr/local/easea/boost/boost/
Ogier Maitre's avatar
Ogier Maitre committed
74
	cp easeagrapher/EaseaGrapher.jar /usr/local/easea/easeagrapher/
Ogier Maitre's avatar
Ogier Maitre committed
75

Joseph Pallamidessi's avatar
Joseph Pallamidessi committed
76
	 
Ogier Maitre's avatar
Ogier Maitre committed
77 78 79 80 81
build:
	@test -d build || mkdir build || echo "Cannot make dir build"
bin:
	@test -d bin || mkdir bin || echo "Cannot make dir bin"

Ogier Maitre's avatar
Ogier Maitre committed
82

Ogier Maitre's avatar
Ogier Maitre committed
83
build/EaseaParse.o: EaseaParse.cpp EaseaLex.cpp
84
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w
Ogier Maitre's avatar
Ogier Maitre committed
85
build/EaseaLex.o:  EaseaLex.cpp
86
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w
Ogier Maitre's avatar
Ogier Maitre committed
87

maitre's avatar
maitre committed
88

Ogier Maitre's avatar
Ogier Maitre committed
89
build/%.o:%.cpp
90
	$(CXX) $(CPPFLAGS) -c -o $@ $<
moh_lo's avatar
moh_lo committed
91

moh_lo's avatar
moh_lo committed
92
#compile library for alex and ayacc unix version
moh_lo's avatar
moh_lo committed
93 94 95
alexyacc/libalex.so:alexyacc/*.cpp
	cd alexyacc && make libalex.so

96 97 98
alexyacc/libalex.a:alexyacc/*.cpp
	cd alexyacc && make libalex.a

99
#ifeq ($(UNAME),Darwin)
100 101
boost/program_options.a:boost/*.cpp
	cd boost && make program_options.a
102
#endif #OS
103

kruger's avatar
kruger committed
104 105 106
#compile libeasea
libeasea/libeasea.a:libeasea/*.cpp
	cd libeasea && make libeasea.a
107

moh_lo's avatar
moh_lo committed
108
clean:
Ogier Maitre's avatar
Ogier Maitre committed
109
	rm -f build/*.o $(EXEC) $(EXEC)_bin
moh_lo's avatar
moh_lo committed
110
	cd alexyacc && make clean
kruger's avatar
kruger committed
111
	cd libeasea && make clean
112
	cd boost && make clean
113
#ifeq ($(UNAME),Darwin)
114
	cd boost && make clean
115
#endif
Cancino Waldo's avatar
Cancino Waldo committed
116
	
Ogier Maitre's avatar
Ogier Maitre committed
117 118
#install:$(EXEC)
#	sudo cp $< /usr/bin/dev-easea
maitre's avatar
maitre committed
119

120 121 122
#ifeq ($(UNAME),Linux)
#realclean: clean
#	rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h
moh_lo's avatar
moh_lo committed
123

Cancino Waldo's avatar
Cancino Waldo committed
124 125 126
# AT commented these lines, because they imply the presence of wine + programs in a specific location
#EaseaParse.cpp: EaseaParse.y
#	wine ~/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ayacc.exe $< -Tcpp -d
moh_lo's avatar
moh_lo committed
127

Cancino Waldo's avatar
Cancino Waldo committed
128 129
#EaseaLex.cpp: EaseaLex.l
#	wine ~/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ALex.exe $< -Tcpp -i
130
#endif