Switch to CMake.
This commit is contained in:
parent
bb0c5c2c78
commit
07bdbbe55e
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
/Monicelli.output
|
/Monicelli.output
|
||||||
/mcc
|
/mcc
|
||||||
|
/build
|
||||||
|
|
|
@ -17,29 +17,24 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
default: compile cleanautogen
|
project(Monicelli)
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
bison2: patch2 default unpatch2
|
find_package(BISON REQUIRED)
|
||||||
|
find_package(FLEX REQUIRED)
|
||||||
|
|
||||||
compile:
|
include_directories(
|
||||||
bison Monicelli.ypp
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
flex Monicelli.lpp
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
g++ \
|
)
|
||||||
-Wall -Wno-deprecated-register -std=c++11 -DYYDEBUG=0 -O2 \
|
|
||||||
Parser.cpp lex.yy.cc Nodes.cpp main.cpp -o mcc
|
|
||||||
|
|
||||||
patch2:
|
add_definitions(-Wall -Wno-deprecated-register -std=c++0x -DYYDEBUG=0 -O2)
|
||||||
# Bison 2 compatibility patch
|
|
||||||
patch -r - -p 1 -N < bison2.patch || true
|
|
||||||
|
|
||||||
unpatch2:
|
bison_target(Parser Monicelli.ypp ${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp)
|
||||||
patch -p 1 -R < bison2.patch
|
flex_target(Scanner Monicelli.lpp ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp)
|
||||||
|
|
||||||
graph:
|
add_executable(
|
||||||
bison --graph Monicelli.y
|
mcc
|
||||||
|
main.cpp Nodes.cpp ${BISON_Parser_OUTPUTS} ${FLEX_Scanner_OUTPUTS}
|
||||||
|
)
|
||||||
|
|
||||||
cleanautogen:
|
|
||||||
rm -f Parser.?pp lex.* location.hh position.hh stack.hh
|
|
||||||
|
|
||||||
clean: cleanautogen
|
|
||||||
rm -f Parser.output Parser.dot
|
|
|
@ -27,7 +27,6 @@
|
||||||
%language "c++"
|
%language "c++"
|
||||||
|
|
||||||
%defines
|
%defines
|
||||||
%output "Parser.cpp"
|
|
||||||
%locations
|
%locations
|
||||||
%token-table
|
%token-table
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user