Remove CMake changes and generic sed scripts so they are move to a separate branch.
This commit is contained in:
parent
a80248f204
commit
f7ba3eec50
|
@ -1,81 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
enable_testing()
|
||||
|
||||
# Watch out on the order of the building, some modules and libraries
|
||||
# must be built before others.
|
||||
|
||||
# if (MSVC)
|
||||
# add_compile_options(/W3 /WX)
|
||||
# else()
|
||||
# add_compile_options(-W -Wall -Werror)
|
||||
# endif()
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/h)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/h)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/alloc)
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/string)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/print)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/flt_arith)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/data)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/system)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/em_data)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/em_code)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/em_mes)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/object)
|
||||
|
||||
# Incomplete, as it should regenerate the em_tables.
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules/src/read_em)
|
||||
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/make)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/arch)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/amisc)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/cmisc)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/LLgen)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/misc)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/topgen)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/cpp)
|
||||
|
||||
# Compilers and runtime libraries
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lang/basic/src)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lang/pc/comp)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lang/cem/cemcom.ansi)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lang/cem/cpp.ansi)
|
||||
|
||||
|
||||
# Should probably not be present, assuming it is installed on target.
|
||||
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/byacc)
|
||||
|
||||
# Compilers / assemblers / linkers
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/6500/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/6800/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/6805/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/6809/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/arm/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/i386/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/i80/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/i86/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/m68020/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/m68k2/as)
|
||||
# Currently unported.
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/mips/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/ns/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/pdp/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/powerpc/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/s2650/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/vax4/as)
|
||||
# Does not build on current CLang 8.0
|
||||
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/vc4/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/z80/as)
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/z8000/as)
|
||||
|
||||
# Old code generators
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/util/cgg)
|
||||
|
||||
# CPU Specific coge generators
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mach/6500/cg)
|
||||
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
project(emheaders)
|
||||
|
||||
# Create an include only library to be used
|
||||
# for easier dependency management.
|
||||
|
||||
# Created when generating the CMake file.
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/local.h "#define VERSION 3")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/local.h "#define ACKM ")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/local.h "#define BIGMACHINE 1")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/local.h "#define SYS_5")
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
project(em_cemcom.ansi)
|
||||
|
||||
|
||||
##################################
|
||||
# Location of built scripts.
|
||||
##################################
|
||||
set(PROJECT_SCRIPTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../util/scripts)
|
||||
|
||||
set(SRC_C
|
||||
align.h
|
||||
arith.c
|
||||
arith.h
|
||||
atw.h
|
||||
blocks.c
|
||||
blocks.h
|
||||
ch3.c
|
||||
ch3.h
|
||||
ch3bin.c
|
||||
ch3bin.h
|
||||
ch3mon.c
|
||||
ch3mon.h
|
||||
class.h
|
||||
code.c
|
||||
conversion.c
|
||||
conversion.h
|
||||
cstoper.c
|
||||
cstoper.h
|
||||
dataflow.c
|
||||
dataflow.h
|
||||
declarator.c
|
||||
declarator.h
|
||||
decspecs.c
|
||||
decspecs.h
|
||||
domacro.c
|
||||
domacro.h
|
||||
dumpidf.c
|
||||
error.c
|
||||
error.h
|
||||
eval.c
|
||||
eval.h
|
||||
expr.c
|
||||
field.c
|
||||
file_info.h
|
||||
fltcstoper.c
|
||||
fltcstoper.h
|
||||
idf.c
|
||||
input.c
|
||||
input.h
|
||||
interface.h
|
||||
idf.c
|
||||
input.c
|
||||
input.h
|
||||
l_class.h
|
||||
l_comment.c
|
||||
l_comment.h
|
||||
l_em.h
|
||||
l_ev_ord.c
|
||||
l_lint.c
|
||||
l_lint.h
|
||||
l_misc.c
|
||||
l_outdef.c
|
||||
l_states.c
|
||||
label.c
|
||||
label.h
|
||||
level.h
|
||||
LLlex.c
|
||||
LLlex.h
|
||||
LLmessage.c
|
||||
main.c
|
||||
mes.h
|
||||
options.c
|
||||
options.h
|
||||
pragma.c
|
||||
pragma.h
|
||||
proto.c
|
||||
sizes.h
|
||||
skip.c
|
||||
skip.h
|
||||
specials.h
|
||||
stab.c
|
||||
stab.h
|
||||
stack.c
|
||||
stb.c
|
||||
struct.c
|
||||
switch.c
|
||||
tokenname.c
|
||||
tokenname.h
|
||||
type.c
|
||||
util.c
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../modules/src/idf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../modules/src/input
|
||||
)
|
||||
|
||||
############################################
|
||||
# LLgen inputs
|
||||
############################################
|
||||
|
||||
set(GEN_G
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tokenfile.g
|
||||
)
|
||||
|
||||
|
||||
|
||||
set(SRC_G
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/program.g
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/declar.g
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/expression.g
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/statement.g
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ival.g
|
||||
)
|
||||
|
||||
|
||||
############################################
|
||||
# LLgen outputs
|
||||
############################################
|
||||
|
||||
set(GEN_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/program.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/declar.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/expression.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/statement.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ival.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tokenfile.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Lpars.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Lpars.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Lncor.c
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(GFILES
|
||||
${GEN_G}
|
||||
${SRC_G}
|
||||
)
|
||||
|
||||
|
||||
|
||||
############################################
|
||||
# Configuration parameters generated files
|
||||
############################################
|
||||
|
||||
set(GEN_H_CONFIG
|
||||
${CMAKE_CURRENT_BINARY_DIR}/parameters.h
|
||||
)
|
||||
|
||||
set(GEN_OTHERS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/code.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/declar.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/def.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/expr.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/field.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/estack.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/util.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/proto.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/replace.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/idf.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/macro.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/stack.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/stmt.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/struct.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/switch.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/type.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/l_brace.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/l_state.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/l_outdef.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/next.c
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CFILES
|
||||
${SRC_C}
|
||||
${GEN_SRC}
|
||||
${GEN_H_CONFIG}
|
||||
${GEN_OTHERS}
|
||||
symbol2str.c
|
||||
char.c
|
||||
)
|
||||
|
||||
set(LLGENOPTIONS
|
||||
-n
|
||||
)
|
||||
|
||||
###############################################
|
||||
# Generate the compile time configuration file
|
||||
###############################################
|
||||
add_custom_command(
|
||||
OUTPUT ${GEN_H_CONFIG} BigPars mkparams.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SCRIPTS_SOURCE_DIR}/mkparams.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mkparams.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BigPars
|
||||
${CMAKE_CURRENT_BINARY_DIR}/BigPars
|
||||
COMMAND sed -f ${PROJECT_SCRIPTS_SOURCE_DIR}/mkparams.sed ${CMAKE_CURRENT_BINARY_DIR}/BigPars>parameters.h
|
||||
DEPENDS BigPars)
|
||||
|
||||
###############################################
|
||||
# Generate other source files
|
||||
###############################################
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${GEN_OTHERS} mkalloc1.sed mkalloc2.sed mknext.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SCRIPTS_SOURCE_DIR}/mkalloc1.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SCRIPTS_SOURCE_DIR}/mkalloc2.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SCRIPTS_SOURCE_DIR}/mknext.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mknext.sed
|
||||
|
||||
|
||||
|
||||
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/code.str>code.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/declar.str>declar.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/def.str>def.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/expr.str>expr.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/field.str>field.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/estack.str>estack.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/util.str>util.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/proto.str>proto.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/idf.str>idf.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/macro.str>macro.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/stack.str>stack.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/stmt.str>stmt.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/struct.str>struct.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/switch.str>switch.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/type.str>type.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_brace.str>l_brace.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_state.str>l_state.h
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc1.sed -f ${CMAKE_CURRENT_BINARY_DIR}/mkalloc2.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_outdef.str>l_outdef.h
|
||||
# Create next file from above files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/next.str
|
||||
${CMAKE_CURRENT_BINARY_DIR}/next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/code.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/declar.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/def.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/expr.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/field.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/estack.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/util.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/proto.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/idf.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/macro.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/stack.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/stmt.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/struct.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/switch.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/type.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_brace.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_state.str>>next.c
|
||||
COMMAND sed -n -f ${CMAKE_CURRENT_BINARY_DIR}/mknext.sed ${CMAKE_CURRENT_SOURCE_DIR}/l_outdef.str>>next.c
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT char.c
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../../../util/cmisc/tabgen -f${CMAKE_CURRENT_SOURCE_DIR}/char.tab >char.c
|
||||
)
|
||||
|
||||
###############################################
|
||||
# Generate the LLGen source files
|
||||
# NOTE: Order of input file is important
|
||||
###############################################
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT tokenfile.g mktkfile.sed
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SCRIPTS_SOURCE_DIR}/mktkfile.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mktkfile.sed
|
||||
COMMAND sed -f ${CMAKE_CURRENT_BINARY_DIR}/mktkfile.sed ${CMAKE_CURRENT_SOURCE_DIR}/tokenname.c>tokenfile.g
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${GEN_SRC}
|
||||
COMMAND ${CMAKE_COMMAND} -E env LLGEN_LIB_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../../../util/LLgen/lib ${CMAKE_CURRENT_BINARY_DIR}/../../../util/LLgen/LLgen ${LLGENOPTIONS} ${GEN_G} ${SRC_G}
|
||||
DEPENDS LLgen tokenfile.g)
|
||||
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT symbol2str.c
|
||||
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/tokcaseh.in >symbol2str.c
|
||||
COMMAND sed -f ${CMAKE_CURRENT_SOURCE_DIR}/tokcase.sed ${CMAKE_CURRENT_SOURCE_DIR}/tokenname.c >>symbol2str.c
|
||||
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/tokcasee.in >>symbol2str.c
|
||||
)
|
||||
|
||||
|
||||
add_executable(${PROJECT_NAME} ${CFILES})
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC NORCSID=1)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} emheaders emh flt alloc print string system em_data eme em_mes)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cemcom.ansi.1 DESTINATION man OPTIONAL)
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
project(emh)
|
||||
|
||||
# Create an include only library to be used
|
||||
# for easier dependency management.
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
project (alloc)
|
||||
|
||||
set(SRC
|
||||
botch.c
|
||||
clear.c
|
||||
Malloc.c
|
||||
No_Mem.c
|
||||
Realloc.c
|
||||
Salloc.c
|
||||
Srealloc.c
|
||||
std_alloc.c
|
||||
st_alloc.c
|
||||
alloc.h
|
||||
)
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "alloc.h")
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/alloc.3 DESTINATION man OPTIONAL)
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project (data)
|
||||
|
||||
set(SRCS
|
||||
array.c
|
||||
array.h
|
||||
astring.c
|
||||
astring.h
|
||||
diagnostics.c
|
||||
diagnostics.h
|
||||
imap.c
|
||||
imap.h
|
||||
pmap.c
|
||||
pmap.h
|
||||
smap.c
|
||||
smap.h
|
||||
stringlist.c
|
||||
stringlist.h
|
||||
)
|
||||
|
||||
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRCS})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIRS})
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "array.h;astring.h;diagnostics.h;imap.h;pmap.h;smap.h;stringlist.h")
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
|
@ -1,99 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project(em_code)
|
||||
|
||||
set(SRC
|
||||
bhcst.c
|
||||
bhdlb.c
|
||||
bhdnam.c
|
||||
bhfcon.c
|
||||
bhicon.c
|
||||
bhilb.c
|
||||
bhpnam.c
|
||||
bhucon.c
|
||||
crcst.c
|
||||
crdlb.c
|
||||
crdnam.c
|
||||
crxcon.c
|
||||
crilb.c
|
||||
crpnam.c
|
||||
crscon.c
|
||||
cst.c
|
||||
dfdlb.c
|
||||
dfdnam.c
|
||||
dfilb.c
|
||||
dlb.c
|
||||
dnam.c
|
||||
end.c
|
||||
endarg.c
|
||||
exc.c
|
||||
fcon.c
|
||||
getid.c
|
||||
icon.c
|
||||
ilb.c
|
||||
insert.c
|
||||
internerr.c
|
||||
msend.c
|
||||
op.c
|
||||
opcst.c
|
||||
opdlb.c
|
||||
opdnam.c
|
||||
opilb.c
|
||||
opnarg.c
|
||||
oppnam.c
|
||||
pnam.c
|
||||
pro.c
|
||||
pronarg.c
|
||||
msstart.c
|
||||
psdlb.c
|
||||
psdnam.c
|
||||
pspnam.c
|
||||
scon.c
|
||||
ucon.c
|
||||
C_out.c
|
||||
failed.c
|
||||
em.c
|
||||
em_codeEK.h
|
||||
em_code.h
|
||||
em_codeCE.h
|
||||
em_codeO.h
|
||||
em_private.h
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
||||
add_library(eme ${SRC})
|
||||
target_include_directories(eme PUBLIC ${INCLUDE_DIRS})
|
||||
target_compile_definitions(eme PRIVATE READABLE_EM)
|
||||
target_link_libraries(eme em_data alloc print system)
|
||||
|
||||
add_library(emk ${SRC})
|
||||
target_include_directories(emk PUBLIC ${INCLUDE_DIRS})
|
||||
target_link_libraries(emk em_data alloc print system)
|
||||
|
||||
set_target_properties(eme PROPERTIES PUBLIC_HEADER "em_codeEK.h")
|
||||
set_target_properties(emk PROPERTIES PUBLIC_HEADER "em_codeEK.h")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT em_codeEK.h file1.tmp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/makeem.sed
|
||||
${CMAKE_CURRENT_BINARY_DIR}/makeem.sed
|
||||
COMMAND sed -f makeem.sed ${CMAKE_CURRENT_SOURCE_DIR}/../../../h/em_table>file1.tmp
|
||||
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/em.nogen file1.tmp>em_codeEK.h
|
||||
COMMENT "Regenerate em_codeEK.h from em_table"
|
||||
)
|
||||
|
||||
install(TARGETS eme emk
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/em_code.3X DESTINATION man OPTIONAL)
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project(em_data)
|
||||
|
||||
set(SRC
|
||||
em_spec.h
|
||||
em_pseu.h
|
||||
em_pseu.c
|
||||
em_mnem.h
|
||||
em_mnem.c
|
||||
em_flag.c
|
||||
em_ptyp.c
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../h
|
||||
)
|
||||
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} emheaders emh)
|
||||
|
||||
add_executable(makeem makeem.c)
|
||||
target_link_libraries(makeem data)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT em_spec.h em_pseu.h em_pseu.c em_mnem.h em_mnem.c em_flag.c
|
||||
COMMAND makeem ${CMAKE_CURRENT_SOURCE_DIR}/../../../h/em_table
|
||||
COMMENT "Generating em_data files"
|
||||
DEPENDS makeem
|
||||
)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,309 +0,0 @@
|
|||
/** A utility to convert the em definition table to generated code.
|
||||
* This is more portable than the shell scripts that currently
|
||||
* exist.
|
||||
*
|
||||
* This tool should only be called if the em_table is changeed, it creates
|
||||
* the following files:
|
||||
* em_spec.h
|
||||
* em_pseu.h
|
||||
* em_pseu.c
|
||||
* em_mnem.h
|
||||
* em_mnem.c
|
||||
* em_flag.c
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "array.h"
|
||||
|
||||
|
||||
|
||||
size_t trimwhitespace(char *out, size_t len, const char *str)
|
||||
{
|
||||
if(len == 0)
|
||||
return 0;
|
||||
|
||||
const char *end;
|
||||
size_t out_size;
|
||||
|
||||
// Trim leading space
|
||||
while(isspace((unsigned char)*str)) str++;
|
||||
|
||||
if(*str == 0) // All spaces?
|
||||
{
|
||||
*out = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Trim trailing space
|
||||
end = str + strlen(str) - 1;
|
||||
while(end > str && isspace((unsigned char)*end)) end--;
|
||||
end++;
|
||||
|
||||
// Set output size to minimum of trimmed string length and buffer size minus 1
|
||||
out_size = (end - str) < len-1 ? (end - str) : len-1;
|
||||
|
||||
// Copy trimmed string and add null terminator
|
||||
memcpy(out, str, out_size);
|
||||
out[out_size] = 0;
|
||||
|
||||
return out_size;
|
||||
}
|
||||
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
|
||||
/** This section contains indexes to the different limits as well as important
|
||||
* constant values */
|
||||
#define SECTION_INDEXES 0
|
||||
/** This section contains the "opcodes" for the different mnemonics */
|
||||
#define SECTION_MNEMONICS SECTION_INDEXES+1
|
||||
/** This section contains the "opcodes" for the em machine */
|
||||
#define SECTION_OPCODES SECTION_MNEMONICS+1
|
||||
|
||||
|
||||
static char inbuffer[BUFFER_SIZE];
|
||||
static char buffer[BUFFER_SIZE];
|
||||
|
||||
static struct array section_index;
|
||||
static struct array section_mnemonics;
|
||||
static struct array section_opcodes;
|
||||
|
||||
|
||||
|
||||
|
||||
/** Separates the string into its separate tokens,
|
||||
* and fills up the column data structure accordingly.
|
||||
*
|
||||
* maxcolumns indicates the maximum number of columns
|
||||
* allowed in the text file.
|
||||
*
|
||||
*/
|
||||
struct array *newrow(char* buffer, int maxcolumns)
|
||||
{
|
||||
char* pch = NULL;
|
||||
int i = 0;
|
||||
int count = 0;
|
||||
struct array *columns = NULL;
|
||||
|
||||
columns = calloc(1,sizeof(struct array));
|
||||
if (columns == NULL)
|
||||
{
|
||||
fprintf(stderr,"Cannot allocate memory.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
pch = strtok (buffer,"\t ");
|
||||
if (pch == NULL)
|
||||
{
|
||||
fprintf(stderr,"Expecting %d columns for indexes.\n",maxcolumns);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
array_append(columns,strdup(pch));
|
||||
count++;
|
||||
for (i = count; i < maxcolumns; i++)
|
||||
{
|
||||
pch = strtok (NULL, "\t ");
|
||||
if (pch == NULL)
|
||||
{
|
||||
fprintf(stderr,"Expecting %d columns for indexes.\n",maxcolumns);
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
}
|
||||
count++;
|
||||
array_append(columns,strdup(pch));
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
|
||||
|
||||
void disposerow(struct array *row)
|
||||
{
|
||||
int i = 0;
|
||||
char* str;
|
||||
for (i = 0; i < row->count; i++)
|
||||
{
|
||||
str = (char*)row->item[i];
|
||||
free(str);
|
||||
row->item[i] = NULL;
|
||||
}
|
||||
free(row);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Copies a null terminated string,
|
||||
* but allocates the memory.
|
||||
*
|
||||
*/
|
||||
char* strdup(const char* s)
|
||||
{
|
||||
int length = strlen(s)+1;
|
||||
char* ptr = malloc(length);
|
||||
memcpy(ptr, s, length);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i = 0;
|
||||
struct array *columns;
|
||||
int value;
|
||||
char *str;
|
||||
|
||||
char c1;
|
||||
char c2;
|
||||
FILE* hfile;
|
||||
FILE* cfile;
|
||||
char str1[3] = {0,0,0};
|
||||
char str2[3] = {0,0,0};
|
||||
/** First opcode value, -1 is invalid. */
|
||||
int fmnem = -1;
|
||||
/** First pseudocode value, -1 is invalid. */
|
||||
int fpseu = -1;
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stdout,"Requires em_table file and pathname\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
FILE *fd = fopen(argv[1],"r");
|
||||
int section = SECTION_INDEXES;
|
||||
fprintf(stdout,"Opening : %s\n",argv[1]);
|
||||
if (fd == NULL)
|
||||
{
|
||||
fprintf(stderr,"Cannot find file.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
while (fgets(inbuffer,BUFFER_SIZE,fd)!=NULL)
|
||||
{
|
||||
/* First section, opcode limits. */
|
||||
trimwhitespace(buffer,BUFFER_SIZE,inbuffer);
|
||||
/** Next section */
|
||||
if (strlen(buffer)==0)
|
||||
{
|
||||
section++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (section == SECTION_INDEXES)
|
||||
{
|
||||
/* Split the row text into columns. */
|
||||
columns = newrow(buffer, 2);
|
||||
array_append(§ion_index, columns);
|
||||
}
|
||||
else
|
||||
if (section == SECTION_MNEMONICS)
|
||||
{
|
||||
columns = newrow(buffer, 3);
|
||||
array_append(§ion_mnemonics, columns);
|
||||
} else
|
||||
if (section == SECTION_OPCODES)
|
||||
{
|
||||
columns = newrow(buffer, 3);
|
||||
array_append(§ion_opcodes, columns);
|
||||
}
|
||||
}
|
||||
fclose(fd);
|
||||
|
||||
/* process the indexes */
|
||||
hfile = fopen("em_spec.h","w");
|
||||
for (i = 0; i < section_index.count; i++)
|
||||
{
|
||||
columns = (struct array*)section_index.item[i];
|
||||
str = columns->item[0];
|
||||
if (strcmp("fpseu",columns->item[0])==0)
|
||||
{
|
||||
fpseu = atoi(columns->item[1]);
|
||||
|
||||
}
|
||||
if (strcmp("fmnem",columns->item[0])==0)
|
||||
{
|
||||
fmnem = atoi(columns->item[1]);
|
||||
|
||||
}
|
||||
fprintf(hfile,"#define sp_%s\t %s\n",columns->item[0],columns->item[1]);
|
||||
}
|
||||
fprintf(hfile,"#define sp_lpseu\t% d\n",fpseu+section_mnemonics.count - 1);
|
||||
fprintf(hfile,"#define sp_lmnem\t %d\n",fmnem+section_opcodes.count - 1);
|
||||
fclose(hfile);
|
||||
|
||||
|
||||
/** Check validity of first indexes. */
|
||||
if ((fpseu == -1) || (fmnem == -1))
|
||||
{
|
||||
fprintf(stderr,"Error fpseu or fmnem first index values are not defined.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* process the pseudocodes */
|
||||
hfile = fopen("em_pseu.h","w");
|
||||
cfile = fopen("em_pseu.c","w");
|
||||
fprintf(cfile,"char em_pseu[][4] = {\n");
|
||||
for (i = 0; i < section_mnemonics.count; i++)
|
||||
{
|
||||
columns = (struct array*)section_mnemonics.item[i];
|
||||
str = columns->item[1];
|
||||
value = atoi(str);
|
||||
fprintf(hfile,"#define ps_%s\t%d\n",columns->item[0],value+fpseu);
|
||||
fprintf(cfile," \"%s\",\n",columns->item[0]);
|
||||
}
|
||||
fprintf(cfile,"};\n");
|
||||
fclose(hfile);
|
||||
fclose(cfile);
|
||||
|
||||
/* process the opcodes */
|
||||
hfile = fopen("em_mnem.h","w");
|
||||
cfile = fopen("em_mnem.c","w");
|
||||
fprintf(cfile,"char em_mnem[][4] = {\n");
|
||||
for (i = 0; i < section_opcodes.count; i++)
|
||||
{
|
||||
columns = (struct array*)section_opcodes.item[i];
|
||||
fprintf(hfile,"#define op_%s\t%d\n",columns->item[0],i+fmnem);
|
||||
fprintf(cfile," \"%s\",\n",columns->item[0]);
|
||||
}
|
||||
fprintf(cfile,"};\n");
|
||||
fclose(hfile);
|
||||
fclose(cfile);
|
||||
|
||||
/* Create the flag files from opcodes */
|
||||
cfile = fopen("em_flag.c","w");
|
||||
fprintf(cfile,"#include \"em_flag.h\"\n");
|
||||
fprintf(cfile,"char em_flag[] = {\n");
|
||||
for (i = 0; i < section_opcodes.count; i++)
|
||||
{
|
||||
columns = (struct array*)section_opcodes.item[i];
|
||||
/* 2nd column indicate the parameter format, always on 2 columns. */
|
||||
if (strlen(columns->item[1])!=2)
|
||||
{
|
||||
fprintf(stderr,"Error opcode type characterstic should be on 2 characters.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
str = (char*)columns->item[1];
|
||||
c1 = toupper(str[0]);
|
||||
c2 = toupper(str[1]);
|
||||
str1[0] = c1;
|
||||
str1[1] = '\0';
|
||||
str2[0] = c2;
|
||||
str2[1] = '\0';
|
||||
if (c1 == '-')
|
||||
strcpy(str1,"NO");
|
||||
if (c2 == '-')
|
||||
strcpy(str2,"NO");
|
||||
fprintf(cfile, "PAR_%s | FLO_%s,\n",str1,str2);
|
||||
}
|
||||
fprintf(cfile,"};\n");
|
||||
fclose(cfile);
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.0)
|
||||
project(em_mes)
|
||||
|
||||
|
||||
set(SRC_C
|
||||
C_ms_com.c
|
||||
C_ms_ego.c
|
||||
C_ms_emx.c
|
||||
C_ms_err.c
|
||||
C_ms_flt.c
|
||||
C_ms_gto.c
|
||||
C_ms_opt.c
|
||||
C_ms_par.c
|
||||
C_ms_reg.c
|
||||
C_ms_src.c
|
||||
C_ms_stb.c
|
||||
C_ms_std.c
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
.
|
||||
)
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC_C})
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC NORCSID=1)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} emheaders emh emk em_data)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/em_mes.3 DESTINATION man OPTIONAL)
|
|
@ -1,48 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project (flt)
|
||||
|
||||
enable_testing()
|
||||
|
||||
set(SRCS
|
||||
b64_add.c
|
||||
b64_sft.c
|
||||
flt_add.c
|
||||
flt_ar2flt.c
|
||||
flt_arith.h
|
||||
flt_chk.c
|
||||
flt_cmp.c
|
||||
flt_div.c
|
||||
flt_flt2ar.c
|
||||
flt_misc.h
|
||||
flt_modf.c
|
||||
flt_mul.c
|
||||
flt_nrm.c
|
||||
flt_str2fl.c
|
||||
flt_umin.c
|
||||
split.c
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRCS})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "flt_arith.h")
|
||||
target_link_libraries(${PROJECT_NAME} emh)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/flt_arith.3 DESTINATION man OPTIONAL)
|
||||
|
||||
#############################################
|
||||
# Test targets
|
||||
#############################################
|
||||
add_executable(testflt test.c)
|
||||
target_link_libraries(testflt ${PROJECT_NAME})
|
||||
|
||||
add_test(NAME ops_testflt COMMAND testsfpu)
|
||||
|
||||
# This is a bug workaround with CMake
|
||||
#add_custom_target(tests COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
# DEPENDS testflt)
|
|
@ -1,27 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project (print)
|
||||
|
||||
set(SRC
|
||||
doprnt.c
|
||||
format.c
|
||||
fprint.c
|
||||
print.c
|
||||
sprint.c
|
||||
print.h
|
||||
param.h
|
||||
)
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "print.h")
|
||||
target_link_libraries(${PROJECT_NAME} string system)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/print.3 DESTINATION man OPTIONAL)
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project (string)
|
||||
|
||||
set(SRC
|
||||
bts2str.c
|
||||
btscat.c
|
||||
btscmp.c
|
||||
btscpy.c
|
||||
btszero.c
|
||||
long2str.c
|
||||
str2bts.c
|
||||
str2long.c
|
||||
strindex.c
|
||||
strrindex.c
|
||||
strzero.c
|
||||
ack_string.h
|
||||
)
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "ack_string.h")
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/string.3 DESTINATION man OPTIONAL)
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project(system)
|
||||
|
||||
set(SRC
|
||||
access.c
|
||||
break.c
|
||||
chmode.c
|
||||
close.c
|
||||
create.c
|
||||
filesize.c
|
||||
lock.c
|
||||
modtime.c
|
||||
open.c
|
||||
read.c
|
||||
remove.c
|
||||
rename.c
|
||||
seek.c
|
||||
stop.c
|
||||
system.c
|
||||
write.c
|
||||
tmpdir.c
|
||||
system.h
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} ${SRC})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "system.h")
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/system.3 DESTINATION man OPTIONAL)
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project(LLgen)
|
||||
|
||||
enable_testing()
|
||||
|
||||
set(SRC
|
||||
src/main.c
|
||||
src/gencode.c
|
||||
src/compute.c
|
||||
src/LLgen.c
|
||||
src/tokens.c
|
||||
src/check.c
|
||||
src/reach.c
|
||||
src/global.c
|
||||
src/name.c
|
||||
src/sets.c
|
||||
src/Lpars.c
|
||||
src/alloc.c
|
||||
src/machdep.c
|
||||
src/cclass.c
|
||||
src/savegram.c
|
||||
src/cclass.h
|
||||
src/extern.h
|
||||
src/io.h
|
||||
src/Lpars.h
|
||||
src/sets.h
|
||||
src/types.h
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS src)
|
||||
|
||||
include_directories(${INCLUDE_DIRS})
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SRC})
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC NDEBUG=1 NON_CORRECTING=1 NORCSID=1)
|
||||
|
||||
# Correcting version.
|
||||
add_executable(llgen_c ${SRC})
|
||||
target_compile_definitions(llgen_c PUBLIC NORCSID=1)
|
||||
|
||||
file(COPY lib DESTINATION .)
|
||||
|
||||
#############################################
|
||||
# Regenerate the actual grammar files
|
||||
#############################################
|
||||
add_custom_target(regenerate
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/tokens.g
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tokens.g
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/Llgen.g
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Llgen.g
|
||||
COMMAND ${PROJECT_NAME} -vvv tokens.g LLgen.g
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Llgen.c ${CMAKE_CURRENT_SOURCE_DIR}/src/LLgen.c
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tokens.c ${CMAKE_CURRENT_SOURCE_DIR}/src/tokens.c
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Lpars.c ${CMAKE_CURRENT_SOURCE_DIR}/src/Lpars.c
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Lpars.h ${CMAKE_CURRENT_SOURCE_DIR}/src/Lpars.h
|
||||
COMMENT "Regenerate grammar files and copy them to source"
|
||||
)
|
||||
add_dependencies(regenerate ${PROJECT_NAME})
|
||||
|
||||
|
||||
|
||||
|
||||
#############################################
|
||||
# Test targets
|
||||
#############################################
|
||||
|
||||
# Try to rebuild the own LLgen grammar.
|
||||
add_test(NAME llgentest COMMAND ${PROJECT_NAME} -vvv
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/tokens.g
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/LLgen.g)
|
||||
|
||||
############################################
|
||||
# Install targets
|
||||
#############################################
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib/static)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/doc/LLgen.1 DESTINATION man OPTIONAL)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/incl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/nc_incl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/nc_rec
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/rec
|
||||
DESTINATION lib)
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.9)
|
||||
project (cmisc)
|
||||
|
||||
|
||||
add_executable(tabgen tabgen.c)
|
||||
target_compile_definitions(tabgen PUBLIC NORCSID=1)
|
||||
|
||||
add_executable(ed ed.c)
|
||||
target_compile_definitions(ed PUBLIC NORCSID=1)
|
||||
|
||||
|
||||
install(TARGETS tabgen ed DESTINATION bin)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tabgen.1
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ed.1
|
||||
DESTINATION man OPTIONAL)
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
cmake_minimum_required (VERSION 2.6)
|
||||
project (ack-make)
|
||||
|
||||
set(SRC
|
||||
check.c
|
||||
input.c
|
||||
macro.c
|
||||
make.c
|
||||
main.c
|
||||
reader.c
|
||||
rules.c
|
||||
h.h
|
||||
)
|
||||
|
||||
# The following should be added if utime.h and unistd.h are
|
||||
# available.
|
||||
|
||||
# add_definitions(-Dunix)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SRC})
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
s/^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$/\
|
||||
\/* allocation definitions of struct \1 *\/\
|
||||
extern char *st_alloc();\
|
||||
extern struct \1 *h_\1;\
|
||||
#ifdef DEBUG\
|
||||
extern int cnt_\1;\
|
||||
extern char *std_alloc();\
|
||||
#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\
|
||||
#else\
|
||||
#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
|
||||
#endif\
|
||||
#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
|
||||
/
|
|
@ -1,12 +0,0 @@
|
|||
s/^.*[ ]STATICALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$/\
|
||||
\/* allocation definitions of struct \1 *\/\
|
||||
extern char *st_alloc();\
|
||||
struct \1 *h_\1;\
|
||||
#ifdef DEBUG\
|
||||
int cnt_\1;\
|
||||
#define new_\1() ((struct \1 *) std_alloc((char **)\&h_\1, sizeof(struct \1), \2, \&cnt_\1))\
|
||||
#else\
|
||||
#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
|
||||
#endif\
|
||||
#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
|
||||
/
|
|
@ -1,4 +0,0 @@
|
|||
s/^.*[ ]ALLOCDEF[ ].*"\(.*\)".*$/struct \1 *h_\1 = 0;\
|
||||
#ifdef DEBUG\
|
||||
int cnt_\1 = 0;\
|
||||
#endif/p
|
|
@ -1,9 +0,0 @@
|
|||
##################################################################
|
||||
# This script is used to generate a parameter header file from
|
||||
# the Parameters files.
|
||||
#
|
||||
# The Parameters file and this script should have UNIX line endings
|
||||
# (\n) otherwise strange issues could occur.
|
||||
#
|
||||
#################################################################
|
||||
/!File: /d
|
|
@ -1,4 +0,0 @@
|
|||
/{[A-Z]/!d
|
||||
s/.*{//
|
||||
s/,.*//
|
||||
s/.*/%token &;/
|
|
@ -1,28 +0,0 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
project(em_topgen)
|
||||
set(SRC
|
||||
main.c
|
||||
topgen.c
|
||||
Lpars.c
|
||||
LLlex.c
|
||||
symtab.c
|
||||
symtab.h
|
||||
pattern.c
|
||||
hash.c
|
||||
token.h
|
||||
tunable.h
|
||||
)
|
||||
set(INCLUDE_DIRS
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT topgen.c Lpars.c Lpars.h
|
||||
COMMAND ${CMAKE_COMMAND} -E env LLGEN_LIB_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../LLgen/lib ${CMAKE_CURRENT_BINARY_DIR}/../LLgen/LLgen "${CMAKE_CURRENT_SOURCE_DIR}/topgen.g"
|
||||
# COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../LLgen/llgen "${CMAKE_CURRENT_SOURCE_DIR}/topgen.g"
|
||||
MAIN_DEPENDENCY topgen.g
|
||||
DEPENDS LLgen)
|
||||
add_executable(topgen ${SRC})
|
||||
target_include_directories(topgen PRIVATE ${INCLUDE_DIRS})
|
||||
target_link_libraries(topgen)
|
||||
install(TARGETS topgen DESTINATION bin)
|
Loading…
Reference in a new issue