Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gdsl-toolkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lovis J.I. Zenz
gdsl-toolkit
Commits
8113e5d7
Commit
8113e5d7
authored
Oct 14, 2016
by
Julian Kranz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted CMake build files
parent
adacc09b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
125 additions
and
64 deletions
+125
-64
CMakeLists.txt
CMakeLists.txt
+34
-24
gdsl.h
gdsl.h
+2
-0
include/gdsl.h
include/gdsl.h
+0
-1
libs/CMakeLists.txt
libs/CMakeLists.txt
+1
-1
libs/cppgdsl/CMakeLists.txt
libs/cppgdsl/CMakeLists.txt
+18
-18
libs/gdsl-multiplex/CMakeLists.txt
libs/gdsl-multiplex/CMakeLists.txt
+32
-0
libs/gdutil/CMakeLists.txt
libs/gdutil/CMakeLists.txt
+19
-5
libs/readhex/CMakeLists.txt
libs/readhex/CMakeLists.txt
+1
-1
tools/CMakeLists.txt
tools/CMakeLists.txt
+18
-14
No files found.
CMakeLists.txt
View file @
8113e5d7
...
...
@@ -28,32 +28,43 @@ foreach(p LIB BIN INCLUDE CMAKE)
endif
()
endforeach
()
macro
(
frontend fend sources
)
set
(
sources_merged
${
sources
}
${
ARGN
}
)
list
(
APPEND FRONTENDS
${
fend
}
)
add_custom_command
(
COMMAND gdsl_compiler --maxIter=42
--runtime=
${
CMAKE_CURRENT_SOURCE_DIR
}
/detail/codegen
--outname=gdsl_
${
fend
}
_rreil_frontend
${
sources_merged
}
OUTPUT gdsl_
${
fend
}
_rreil_frontend.c gdsl_
${
fend
}
_rreil_frontend.h
DEPENDS gdsl_compiler
${
sources_merged
}
file
(
GLOB_RECURSE MLTON_SOURCES
"detail/**.ml"
)
add_library
(
gdsl_
${
fend
}
_rreil gdsl_
${
fend
}
_rreil_frontend.c
)
set_target_properties
(
gdsl_
${
fend
}
_rreil PROPERTIES COMPILE_FLAGS
"-std=c11 -fPIC -m32"
)
target_include_directories
(
gdsl_
${
fend
}
_rreil PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/ arch/
${
fend
}
/>
$<INSTALL_INTERFACE:arch/
${
fend
}
/> $<INSTALL_INTERFACE:
${
INSTALL_BIN_DIR
}
>
# <prefix>/include/
add_custom_command
(
COMMAND mlton -output
${
CMAKE_BINARY_DIR
}
/gdslc
${
CMAKE_SOURCE_DIR
}
/gdslc.mlb
OUTPUT gdslc
DEPENDS gdslc.mlb
${
MLTON_SOURCES
}
)
list
(
APPEND EXPORT_LIBRARIES gdsl_
${
fend
}
_rreil
)
install
(
TARGETS gdsl_
${
fend
}
_rreil
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
macro
(
frontend fend sources
)
set
(
sources_merged
${
sources
}
${
ARGN
}
)
list
(
APPEND FRONTENDS
${
fend
}
)
add_custom_command
(
COMMAND ./gdslc --maxIter=42
--runtime=
${
CMAKE_CURRENT_SOURCE_DIR
}
/detail/codegen
--outname=gdsl-
${
fend
}
-rreil
${
sources_merged
}
OUTPUT gdsl-
${
fend
}
-rreil.c gdsl-
${
fend
}
-rreil.h
DEPENDS
${
CMAKE_BINARY_DIR
}
/gdslc
${
sources_merged
}
)
add_library
(
gdsl_
${
fend
}
_rreil gdsl-
${
fend
}
-rreil.c
)
set_target_properties
(
gdsl_
${
fend
}
_rreil PROPERTIES COMPILE_FLAGS
"-std=c11 -fPIC"
)
target_include_directories
(
gdsl_
${
fend
}
_rreil PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/ arch/
${
fend
}
/>
$<INSTALL_INTERFACE:arch/
${
fend
}
/> $<INSTALL_INTERFACE:
${
INSTALL_BIN_DIR
}
>
# <prefix>/include/
)
string
(
TOUPPER
${
fend
}
FEND
)
target_compile_definitions
(
gdsl_
${
fend
}
_rreil PUBLIC
"USE_
${
FEND
}
_RREIL"
)
list
(
APPEND EXPORT_LIBRARIES gdsl_
${
fend
}
_rreil
)
install
(
TARGETS gdsl_
${
fend
}
_rreil
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
endmacro
(
frontend
)
set
(
GDSL_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/specifications
)
...
...
@@ -136,7 +147,6 @@ frontend(mips ${FRONTEND_SRCS_COMMON}
${
GDSL_DIR
}
/mips/mips-traverse_r6.ml
)
add_subdirectory
(
gdslc
)
add_subdirectory
(
libs
)
add_subdirectory
(
tools
)
...
...
gdsl.h
View file @
8113e5d7
...
...
@@ -13,6 +13,8 @@
#include "gdsl-mips.h"
#elif USE_MIPS_RREIL
#include "gdsl-mips-rreil.h"
#elif USE_ARM7_RREIL
#include "gdsl-arm7-rreil.h"
#endif
include/gdsl.h
deleted
120000 → 0
View file @
adacc09b
..
/
gdsl_manual
.
h
\ No newline at end of file
libs/CMakeLists.txt
View file @
8113e5d7
cmake_minimum_required
(
VERSION 2.8
)
project
(
gdsl-libs
)
add_subdirectory
(
multiplex_stub
)
add_subdirectory
(
gdsl-multiplex
)
add_subdirectory
(
cppgdsl
)
add_subdirectory
(
readhex
)
add_subdirectory
(
gdutil
)
...
...
libs/cppgdsl/CMakeLists.txt
View file @
8113e5d7
...
...
@@ -12,27 +12,27 @@ file(GLOB_RECURSE SOURCES
#set_property(TARGET cppgdsl PROPERTY CXX_STANDARD 11)
macro
(
cppgdsl fend
)
add_library
(
cppgdsl_
${
fend
}
${
SOURCES
}
)
set_target_properties
(
cppgdsl_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-fPIC -std=c++11 -m32
"
)
target_include_directories
(
cppgdsl_
${
fend
}
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/>
$<INSTALL_INTERFACE:include/>
# <prefix>/include/
)
target_link_libraries
(
cppgdsl_
${
fend
}
multiplex_stub
_
${
fend
}
)
list
(
APPEND EXPORT_LIBRARIES cppgdsl_
${
fend
}
)
install
(
TARGETS cppgdsl_
${
fend
}
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
add_library
(
cppgdsl_
${
fend
}
${
SOURCES
}
)
set_target_properties
(
cppgdsl_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-fPIC -std=c++11
"
)
target_include_directories
(
cppgdsl_
${
fend
}
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/>
$<INSTALL_INTERFACE:include/>
# <prefix>/include/
)
target_link_libraries
(
cppgdsl_
${
fend
}
multiplex
_
${
fend
}
)
list
(
APPEND EXPORT_LIBRARIES cppgdsl_
${
fend
}
)
install
(
TARGETS cppgdsl_
${
fend
}
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
endmacro
(
cppgdsl
)
foreach
(
fend
${
FRONTENDS
}
)
cppgdsl
(
${
fend
}
)
cppgdsl
(
${
fend
}
)
endforeach
(
fend
)
set
(
EXPORT_LIBRARIES
${
EXPORT_LIBRARIES
}
PARENT_SCOPE
)
libs/gdsl-multiplex/CMakeLists.txt
0 → 100644
View file @
8113e5d7
cmake_minimum_required
(
VERSION 2.8
)
project
(
multiplex
)
file
(
GLOB_RECURSE SOURCES
"src/**.c"
)
macro
(
multiplex fend
)
add_library
(
multiplex_
${
fend
}
${
SOURCES
}
)
target_include_directories
(
multiplex_
${
fend
}
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/>
$<INSTALL_INTERFACE:include/>
# <prefix>/include/
)
set_target_properties
(
multiplex_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
target_link_libraries
(
multiplex_
${
fend
}
dl
)
list
(
APPEND EXPORT_LIBRARIES multiplex_
${
fend
}
)
install
(
TARGETS multiplex_
${
fend
}
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
endmacro
(
multiplex
)
foreach
(
fend
${
FRONTENDS
}
)
multiplex
(
${
fend
}
)
endforeach
(
fend
)
set
(
EXPORT_LIBRARIES
${
EXPORT_LIBRARIES
}
PARENT_SCOPE
)
libs/gdutil/CMakeLists.txt
View file @
8113e5d7
...
...
@@ -5,13 +5,27 @@ file(GLOB_RECURSE SOURCES
"src/**.c"
)
function
(
gdutil fend
)
macro
(
gdutil fend
)
add_library
(
gdutil_
${
fend
}
${
SOURCES
}
)
target_include_directories
(
gdutil_
${
fend
}
PUBLIC include/
)
set_target_properties
(
gdutil_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11 -m32"
)
target_link_libraries
(
gdutil_
${
fend
}
multiplex_stub_
${
fend
}
)
endfunction
(
gdutil
)
target_include_directories
(
gdutil_
${
fend
}
PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/>
$<INSTALL_INTERFACE:include/>
# <prefix>/include/
)
set_target_properties
(
gdutil_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
list
(
APPEND EXPORT_LIBRARIES gdutil_
${
fend
}
)
install
(
TARGETS gdutil_
${
fend
}
# IMPORTANT: Add the library to the "export-set"
EXPORT gdslTargets
RUNTIME DESTINATION
"
${
INSTALL_BIN_DIR
}
"
COMPONENT bin
LIBRARY DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
ARCHIVE DESTINATION
"
${
INSTALL_LIB_DIR
}
"
COMPONENT lib
PUBLIC_HEADER DESTINATION
"
${
INSTALL_INCLUDE_DIR
}
/"
COMPONENT dev
)
endmacro
(
gdutil
)
foreach
(
fend
${
FRONTENDS
}
)
gdutil
(
${
fend
}
)
endforeach
(
fend
)
set
(
EXPORT_LIBRARIES
${
EXPORT_LIBRARIES
}
PARENT_SCOPE
)
libs/readhex/CMakeLists.txt
View file @
8113e5d7
...
...
@@ -6,7 +6,7 @@ file(GLOB_RECURSE SOURCES
)
add_library
(
readhex
${
SOURCES
}
)
set_target_properties
(
readhex PROPERTIES COMPILE_FLAGS
"-std=c11
-m32
"
)
set_target_properties
(
readhex PROPERTIES COMPILE_FLAGS
"-std=c11"
)
target_include_directories
(
readhex PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/>
$<INSTALL_INTERFACE:include/>
# <prefix>/include/
...
...
tools/CMakeLists.txt
View file @
8113e5d7
...
...
@@ -6,37 +6,41 @@ project (gdsl-tools)
#set_property(TARGET cppgdsl PROPERTY CXX_STANDARD 11)
function
(
semantics_cli fend
)
string
(
TOUPPER
${
fend
}
FEND
)
add_executable
(
semantics_cli_
${
fend
}
semantics-cli.c
)
set_target_properties
(
semantics_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11
-m32
"
)
set_target_properties
(
semantics_cli_
${
fend
}
PROPERTIES LINK_FLAGS
"
-m32
"
)
target_link_libraries
(
semantics_cli_
${
fend
}
readhex gdutil_
${
fend
}
)
set_target_properties
(
semantics_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
set_target_properties
(
semantics_cli_
${
fend
}
PROPERTIES LINK_FLAGS
""
)
target_link_libraries
(
semantics_cli_
${
fend
}
gdsl_
${
fend
}
_rreil
readhex gdutil_
${
fend
}
)
endfunction
(
semantics_cli
)
function
(
decoder_cli fend
)
string
(
TOUPPER
${
fend
}
FEND
)
add_executable
(
decoder_cli_
${
fend
}
decoder-cli.c
)
set_target_properties
(
decoder_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11
-m32
"
)
set_target_properties
(
decoder_cli_
${
fend
}
PROPERTIES LINK_FLAGS
"
-m32
"
)
target_link_libraries
(
decoder_cli_
${
fend
}
readhex gdutil_
${
fend
}
)
set_target_properties
(
decoder_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
set_target_properties
(
decoder_cli_
${
fend
}
PROPERTIES LINK_FLAGS
""
)
target_link_libraries
(
decoder_cli_
${
fend
}
gdsl_
${
fend
}
_rreil
readhex gdutil_
${
fend
}
)
endfunction
(
decoder_cli
)
function
(
semantics_opt fend
)
string
(
TOUPPER
${
fend
}
FEND
)
add_executable
(
semantics_opt_
${
fend
}
semantics-opt.c
)
set_target_properties
(
semantics_opt_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11
-m32
"
)
set_target_properties
(
semantics_opt_
${
fend
}
PROPERTIES LINK_FLAGS
"
-m32
"
)
target_link_libraries
(
semantics_opt_
${
fend
}
multiplex_stub_
${
fend
}
gdutil_
${
fend
}
elf
)
set_target_properties
(
semantics_opt_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
set_target_properties
(
semantics_opt_
${
fend
}
PROPERTIES LINK_FLAGS
""
)
target_link_libraries
(
semantics_opt_
${
fend
}
gdsl_
${
fend
}
_rreil
gdutil_
${
fend
}
elf
)
endfunction
(
semantics_opt
)
function
(
semantics_cif_cli fend
)
string
(
TOUPPER
${
fend
}
FEND
)
add_executable
(
semantics_cif_cli_
${
fend
}
semantics-cif-cli.c
)
set_target_properties
(
semantics_cif_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11
-m32
"
)
set_target_properties
(
semantics_cif_cli_
${
fend
}
PROPERTIES LINK_FLAGS
"
-m32
"
)
target_link_libraries
(
semantics_cif_cli_
${
fend
}
multiplex_stub_
${
fend
}
gdutil_
${
fend
}
readhex
)
set_target_properties
(
semantics_cif_cli_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c11"
)
set_target_properties
(
semantics_cif_cli_
${
fend
}
PROPERTIES LINK_FLAGS
""
)
target_link_libraries
(
semantics_cif_cli_
${
fend
}
gdsl_
${
fend
}
_rreil
gdutil_
${
fend
}
readhex
)
endfunction
(
semantics_cif_cli
)
function
(
cppgdsl_demo fend
)
add_executable
(
cppgdsl_demo_
${
fend
}
cppgdsl-demo.cpp
)
set_target_properties
(
cppgdsl_demo_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c++11
-m32
"
)
set_target_properties
(
cppgdsl_demo_
${
fend
}
PROPERTIES LINK_FLAGS
"
-m32
"
)
set_target_properties
(
cppgdsl_demo_
${
fend
}
PROPERTIES COMPILE_FLAGS
"-std=c++11"
)
set_target_properties
(
cppgdsl_demo_
${
fend
}
PROPERTIES LINK_FLAGS
""
)
target_link_libraries
(
cppgdsl_demo_
${
fend
}
cppgdsl_
${
fend
}
)
endfunction
(
cppgdsl_demo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment