makefile 1.27 KB
Newer Older
moh_lo's avatar
moh_lo committed
1
EXEC = main.out
moh_lo's avatar
moh_lo committed
2
CPPFLAGS = -DUNIX_OS -Ialexyacc/include/ -DDEBUG
moh_lo's avatar
moh_lo committed
3
CPPC = g++
moh_lo's avatar
moh_lo committed
4 5
LDFLAGS = 

moh_lo's avatar
moh_lo committed
6 7

$(EXEC):EaseaSym.o EaseaLex.o EaseaParse.o alexyacc/libalex.so
moh_lo's avatar
moh_lo committed
8
#$(EXEC):EaseaSym.o easealex.o EaseaParse.o alexyacc/libalex.so
moh_lo's avatar
moh_lo committed
9
	$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
moh_lo's avatar
moh_lo committed
10 11 12 13 14


%.o:%.cpp
	$(CPPC) $(CPPFLAGS) -c -o $@ $<

moh_lo's avatar
moh_lo committed
15 16 17
EaseaParse.cpp:winreceive
EaseaLex.cpp:winreceive

moh_lo's avatar
moh_lo committed
18
#compile library for alex and ayacc unix version
moh_lo's avatar
moh_lo committed
19 20 21 22
alexyacc/libalex.so:alexyacc/*.cpp
	cd alexyacc && make libalex.so

clean:
moh_lo's avatar
moh_lo committed
23 24
	rm -f *.o $(EXEC)
	rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h
moh_lo's avatar
moh_lo committed
25 26 27
	cd alexyacc && make clean


moh_lo's avatar
moh_lo committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#handle file between windows and local directory
winclean:
	rm -f $(TMP_DIR)/EaseaLex.cpp $(TMP_DIR)/EaseaLex.h $(TMP_DIR)/EaseaParse.cpp $(TMP_DIR)/EaseaParse.h $(TMP_DIR)/EaseaParse.v

winrealclean: winclean
	rm -f $(TMP_DIR)/EaseaParse.y $(TMP_DIR)/EaseaLex.l

#send alex and ayacc files to windows
winsend: winsend_l winsend_y
winsend_l:
	sudo cp EaseaLex.l $(TMP_DIR)/
winsend_y:
	sudo cp EaseaParse.y $(TMP_DIR)/

#receveive alex and ayacc files from windows
winreceive: winreceive_l winreceive_y

winreceive_l:
	cp $(TMP_DIR)/EaseaLex.cpp $(TMP_DIR)/EaseaLex.h ./
moh_lo's avatar
moh_lo committed
47
	chmod -x EaseaLex.cpp EaseaLex.h
moh_lo's avatar
moh_lo committed
48 49 50

winreceive_y:
	cp $(TMP_DIR)/EaseaParse.cpp $(TMP_DIR)/EaseaParse.h ./
moh_lo's avatar
moh_lo committed
51
	chmod -x EaseaParse.cpp EaseaParse.h