Makefile.old 3.68 KB
Newer Older
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 79 80 81 82 83
UNAME := $(shell uname)
ifeq ($(shell uname -o 2>/dev/null),Msys)
	OS := MINGW
endif
EXEC = bin/easea
CPPFLAGS += -DUNIX_OS -Ialexyacc/include/ -g  -Wno-deprecated -DDEBUG -DLINE_NUM_EZ_FILE
LDFLAGS = 

OBJ= build/EaseaSym.o build/EaseaParse.o build/EaseaLex.o alexyacc/libalex.a build/EaseaYTools.o boost/program_options.a libeasea/libeasea.a

#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:
	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/
	cp tpl/* /usr/local/easea/tpl/
	cp libeasea/include/* /usr/local/easea/libeasea/include/
	cp libeasea/libeasea.a /usr/local/easea/libeasea/
	cp boost/program_options.a /usr/local/easea/boost
	cp -r boost/boost/ /usr/local/easea/boost/boost/
	cp easeagrapher/EaseaGrapher.jar /usr/local/easea/easeagrapher/

	 
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: EaseaParse.cpp EaseaLex.cpp
84
	cd compiler
85 86
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w
build/EaseaLex.o:  EaseaLex.cpp
87
	cd compiler
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 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
	$(CXX) $(CPPFLAGS) $< -o $@ -c -w


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

#compile library for alex and ayacc unix version
alexyacc/libalex.so:alexyacc/*.cpp
	cd alexyacc && make libalex.so

alexyacc/libalex.a:alexyacc/*.cpp
	cd alexyacc && make libalex.a

#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 alexyacc && make clean
	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