Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Makefile 3.79 KB
Newer Older
1
2
3
4
UNAME := $(shell uname)
ifeq ($(shell uname -o 2>/dev/null),Msys)
	OS := MINGW
endif
5
6
YACC=bison
LEX=flex
7
EXEC = bin/easea
8
CPPFLAGS += -DUNIX_OS -g -Wno-deprecated -DDEBUG -DLINE_NUM_EZ_FILE
9
10
LDFLAGS = 

11
OBJ= build/EaseaSym.o build/EaseaParse.o build/EaseaLex.o build/EaseaYTools.o boost/program_options.a libeasea/libeasea.a
12

13
14
15
DESTDIR=
PREFIX=/usr/local

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
#ifeq ($(UNAME),Darwin)
$(EXEC):build bin $(OBJ)
	$(CXX) $(CPPFLAGS) $(LDFLAGS) $(OBJ) -o $@ 
ifneq ("$(OS)","")
	#
	# 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.
	#
else
	#
	# Congratulations !  It looks like you compiled EASEA successfully.
	# 
	# You can now install easea into your system or use it from 
	# its current directory.
	#
	# Installation:
	# To install EASEA into your system, type:
	#	 ". install.sh ".
	# EASEA will be installed into /usr/local/easea/ directory,
	# 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.
else
	# into your .bashrc file.
endif
	# 
	# 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
	#	 ". install.sh local". 
	#
	# Thanks for using EASEA.
	#
endif

# $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so
# 	$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@


# $(EXEC)_bin:EaseaSym.o EaseaParse.o EaseaLex.o 
# 	$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex


install:
72
73
74
75
76
77
78
79
80
81
82
83
84
	mkdir -p $(DESTDIR)$(PREFIX)/easea
	mkdir -p $(DESTDIR)$(PREFIX)/easea/bin
	mkdir -p $(DESTDIR)$(PREFIX)/easea/tpl
	mkdir -p $(DESTDIR)$(PREFIX)/easea/include
	mkdir -p $(DESTDIR)$(PREFIX)/easea/boost
	mkdir -p $(DESTDIR)$(PREFIX)/easea/easeagrapher
	cp bin/easea $(DESTDIR)$(PREFIX)/easea/bin/
	cp tpl/* $(DESTDIR)$(PREFIX)/easea/tpl/
	cp libeasea/include/* $(DESTDIR)$(PREFIX)/easea/libeasea/include/
	cp libeasea/libeasea.a $(DESTDIR)$(PREFIX)/easea/libeasea/
	cp boost/program_options.a $(DESTDIR)$(PREFIX)/easea/boost
	cp -r boost/boost/ $(DESTDIR)$(PREFIX)/easea/boost/boost/
	cp easeagrapher/EaseaGrapher.jar $(DESTDIR)$(PREFIX)/easea/easeagrapher/
85
86
87
88
89
90
91
92
93
94

	 
build:
	@test -d build || mkdir build || echo "Cannot make dir build"
bin:
	@test -d bin || mkdir bin || echo "Cannot make dir bin"


build/EaseaParse.o: compiler/EaseaParse.cpp compiler/EaseaLex.cpp
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w
95
build/EaseaLex.o:  compiler/EaseaLex.cpp compiler/EaseaParse.hpp
96
97
98
99
100
101
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w


build/%.o:compiler/%.cpp
	$(CXX) $(CPPFLAGS) -c -o $@ $<

102
103
compiler/EaseaParse.cpp:compiler/EaseaParse.y
	$(YACC) -d -o $@ $<
104

105
compiler/EaseaLex.cpp:compiler/EaseaLex.l
Thomas Kuntz's avatar
Thomas Kuntz committed
106
	$(LEX) -o $@ $<
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

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

#compile libeasea
libeasea/libeasea.a:libeasea/*.cpp
	cd libeasea && make libeasea.a

clean:
	rm -f build/*.o $(EXEC) $(EXEC)_bin
	cd libeasea && make clean
	cd boost && make clean
#ifeq ($(UNAME),Darwin)
	cd boost && make clean
#endif
	
#install:$(EXEC)
#	sudo cp $< /usr/bin/dev-easea

#ifeq ($(UNAME),Linux)
#realclean: clean
#	rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h

# 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

#EaseaLex.cpp: EaseaLex.l
#	wine ~/.wine/drive_c/Program\ Files/Parser\ Generator/BIN/ALex.exe $< -Tcpp -i
#endif