F diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignoreCMakeCache.txtcmake_install.cmakeMakefile- buildtagscscope.outF diff --git a/build/cmake/generator.txt b/build/cmake/generator.txt new file mode 100644 --- /dev/null +++ b/build/cmake/generator.txt+ set(GENERATOR_SOURCES+ src/frontend/lex/automatas/generator/generator.c+ src/frontend/lex/automatas/automata.c+ src/frontend/lex/automatas/generator/keyword_list.c+ )++ add_executable(generator ${GENERATOR_SOURCES})++ target_link_libraries(generator wonky_assert misc)++ add_custom_command(POST_BUILD COMMAND generator+ ARGS ${CMAKE_BINARY_DIR}+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}+ VERBATIM+ OUTPUT ${CMAKE_BINARY_DIR}/chonky.c)+F diff --git a/build/cmake/include_directories.txt b/build/cmake/include_directories.txt new file mode 100644 --- /dev/null +++ b/build/cmake/include_directories.txt+ include_directories(src/)+ include_directories(src/backend/js)+ include_directories(src/backend/text/print)+ include_directories(src/backend/text)+ include_directories(src/backend/asm)+ include_directories(src/backend/asm/intel)+ include_directories(src/backend)+ include_directories(src/frontend)+ include_directories(src/frontend/lex)+ include_directories(src/frontend/lex/automatas)+ include_directories(src/frontend/lex/automatas/generator)+ include_directories(src/frontend/parse)+ include_directories(src/semantics)+ include_directories(src/semantics/identifiers)+ include_directories(src/semantics/memory)+ include_directories(src/semantics/value)+ include_directories(src/semantics/constraints)+ include_directories(src/semantics/program)+ include_directories(src/debug)+ include_directories(src/debug/wobler)+ include_directories(src/misc)+ include_directories(src/environment)+ include_directories(src/environment/command_arguments)+ include_directories(src/environment/error)+F diff --git a/build/cmake/libs.txt b/build/cmake/libs.txt new file mode 100644 --- /dev/null +++ b/build/cmake/libs.txt+ include(build/cmake/libs/misc.txt)+ include(build/cmake/libs/innards.txt)+ include(build/cmake/libs/wonky_assert.txt)+ include(build/cmake/libs/wobler_assert.txt)+F diff --git a/build/cmake/libs/innards.txt b/build/cmake/libs/innards.txt new file mode 100644 --- /dev/null +++ b/build/cmake/libs/innards.txt+ add_library(innards STATIC+ src/backend/asm/intel/intel_asm.c+ src/backend/asm/intel/intel_compile.c+ src/backend/asm/intel/intel_instruction.c+ src/backend/asm/intel/intel_location.c+ src/backend/compile.c+ src/backend/text/lines.c+ src/backend/text/print/print.c+ src/debug/debug_ast.c+ src/debug/debug_ast.c+ src/debug/debug_denoted.c+ src/debug/debug_initialiser.c+ src/debug/debug_lexer.c+ src/debug/debug_linkage.c+ src/debug/debug_scope.c+ src/debug/debug_type.c+ src/debug/debug_value.c+ src/environment/command_arguments/gcc_arguments.c+ src/environment/error/gcc_error.c+ ${CMAKE_BINARY_DIR}/chonky.c+ #src/frontend/lex/automatas/chonky_jr.c+ src/frontend/lex/automatas/automata.c+ src/frontend/lex/lexer.c+ src/frontend/lex/preprocessing.c+ src/frontend/parse/parse_declaration.c+ src/frontend/parse/parse_expression.c+ src/frontend/parse/parse_statement.c+ src/frontend/parse/parse_translation_unit.c+ src/semantics/ast.c+ src/semantics/constraints/expression_constraints.c+ src/semantics/constraints/initialiser_constraints.c+ src/semantics/constraints/linkage_constraints.c+ src/semantics/constraints/statement_constraints.c+ src/semantics/identifiers/denoted.c+ src/semantics/identifiers/linkage.c+ src/semantics/identifiers/scope.c+ src/semantics/memory/location.c+ src/semantics/memory/object.c+ src/semantics/program/program.c+ src/semantics/value/constant.c+ src/semantics/value/evaluation.c+ src/semantics/value/initialiser.c+ src/semantics/value/type.c+ src/semantics/value/value.c+ )F diff --git a/build/cmake/libs/misc.txt b/build/cmake/libs/misc.txt new file mode 100644 --- /dev/null +++ b/build/cmake/libs/misc.txt+ add_library(misc STATIC+ src/misc/gcc_string.c+ src/misc/gcc_string.h+ src/misc/map.c+ src/misc/map.h+ src/misc/map.hh+ src/misc/queue.c+ src/misc/queue.h+ src/misc/queue.hh+ src/misc/stack.c+ src/misc/stack.h+ src/misc/stack.hh+ src/misc/wonky_malloc.c+ src/misc/wonky_malloc.h+ src/misc/wonky_malloc.hh+ )F diff --git a/build/cmake/libs/wobler_assert.txt b/build/cmake/libs/wobler_assert.txt new file mode 100644 --- /dev/null +++ b/build/cmake/libs/wobler_assert.txt+ add_library(wobler_assert STATIC src/debug/wobler/wobler_assert.c)F diff --git a/build/cmake/libs/wonky_assert.txt b/build/cmake/libs/wonky_assert.txt new file mode 100644 --- /dev/null +++ b/build/cmake/libs/wonky_assert.txt+ add_library(wonky_assert STATIC src/debug/wonky_assert.c)F diff --git a/build/cmake/prebuild.txt b/build/cmake/prebuild.txt new file mode 100644 --- /dev/null +++ b/build/cmake/prebuild.txt+ if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)+ message(FATAL_ERROR "Build directory should be in a seperate directory")+ endif(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)++ if( NOT CMAKE_BUILD_TYPE)+ set(CMAKE_BUILD_TYPE "Debug")+ endif( NOT CMAKE_BUILD_TYPE)++ set(TEST_DIR ${CMAKE_SOURCE_DIR}/tests)+ set(WOBLER_DUMP_LOG ${CMAKE_BINARY_DIR}/log.wobler)+F diff --git a/build/cmake/wobler.txt b/build/cmake/wobler.txt new file mode 100644 --- /dev/null +++ b/build/cmake/wobler.txt+ add_executable(wobler EXCLUDE_FROM_ALL src/debug/wobler/wobler.c)++ target_link_libraries(wobler innards wobler_assert misc)+ add_custom_target(test DEPENDS wobler wobler_assert)++ add_custom_command(TARGET test POST_BUILD COMMAND wobler ARGS ${WOBLER_DUMP_LOG} WORKING_DIRECTORY ${TEST_DIR} VERBATIM)++ add_custom_command(TARGET test PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests ${CMAKE_BINARY_DIR})+ add_custom_command(TARGET test PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests ${CMAKE_BINARY_DIR})++ file(COPY ${CMAKE_SOURCE_DIR}/tools/wsh DESTINATION ${CMAKE_BINARY_DIR})F diff --git a/build/cmake/wonky.txt b/build/cmake/wonky.txt new file mode 100644 --- /dev/null +++ b/build/cmake/wonky.txt+ add_executable(wonky src/wonky.c)+ target_link_libraries(wonky innards wonky_assert misc)