diff --git a/CMakeLists.txt b/CMakeLists.txt index ebf1288d..0c9feb62 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,6 @@ endif () add_subdirectory(clapack-3.2.1-CMAKE) add_subdirectory(CBLAS) -add_subdirectory(plover) add_subdirectory(libfec) add_subdirectory(src) add_subdirectory(docs) diff --git a/plover/AmbiguityTest.hs b/plover/AmbiguityTest.hs deleted file mode 100644 index 2d606c0f..00000000 --- a/plover/AmbiguityTest.hs +++ /dev/null @@ -1,33 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -module AmbiguityTest (cu) where - -import Plover.Types -import Plover.Macros -import Plover.Compile - -testStruct = StructDecl "test_struct_t" ( - ST Generated [ - ("n", IntType), - ("xs", VecType [22] NumType) - ] - ) - -helloPlover :: FunctionDefinition -helloPlover = ("hello_world", FnT [] [] IntType, body) - where - body :: CExpr - body = seqList $ [ - Ref "printf" :$ StrLit "hello world\n", - Return 0 - ] - -cu :: CompilationUnit -cu = CU - { unitName = "ambiguity_test" - , sourceDefs = [helloPlover] - , sourceIncs = ["stdio.h", "plover/ambiguity_test.h"] - , headerDefs = [testStruct] - , headerIncs = ["common.h"] - } - diff --git a/plover/CMakeLists.txt b/plover/CMakeLists.txt deleted file mode 100644 index 3d60985e..00000000 --- a/plover/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -# Working dir -set (PLOVER_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "") - -# Output dirs -set (PLOVER_GENERATED_C_DIR ${CMAKE_SOURCE_DIR}/src/plover CACHE INTERNAL "") -file(MAKE_DIRECTORY ${PLOVER_GENERATED_C_DIR}) -set (PLOVER_GENERATED_H_DIR ${CMAKE_SOURCE_DIR}/include/libswiftnav/plover CACHE INTERNAL "") -file(MAKE_DIRECTORY ${PLOVER_GENERATED_H_DIR}) - -# Find default cabal -find_program(CMAKE_cabal NAMES cabal) - -if (DEFINED ENV{CABAL}) - message("Saw cabal flag: $ENV{CABAL}") - set (CMAKE_cabal $ENV{CABAL}) -else () - message("Environment variable 'CABAL' not set. Defaulting to ${CMAKE_cabal}.") -endif () - -set (plover_HS_SRCS - Main.hs - AmbiguityTest.hs -) - -set (plover_SRCS - ${PLOVER_GENERATED_C_DIR}/ambiguity_test.c - CACHE INTERNAL "" -) - -set (plover_HDRS - ${PLOVER_GENERATED_H_DIR}/ambiguity_test.h - CACHE INTERNAL "" -) - -if (CMAKE_cabal) - message("\nFound Haskell tools. Adding code generation step (to be run if Haskell subproject is modified).\n") - add_custom_command( - OUTPUT ${plover_SRCS} ${plover_HDRS} - COMMAND ${CMAKE_cabal} run "${PLOVER_GENERATED_C_DIR}" "${PLOVER_GENERATED_H_DIR}" - WORKING_DIRECTORY ${PLOVER_DIR} - DEPENDS ${plover_HS_SRCS}) -else () - message("\nNo Haskell toolchain (cabal) found. Code generation with Plover is disabled.\n") -endif () - -add_custom_target(clean_generate - COMMAND ${CMAKE_COMMAND} -E remove_directory ${PLOVER_DIR}/dist - COMMAND ${CMAKE_COMMAND} -E remove ${PLOVER_GENERATED_C_DIR}/* - COMMAND ${CMAKE_COMMAND} -E remove ${PLOVER_GENERATED_H_DIR}/* -) - -# Main project depends on generated code -add_custom_target(generate DEPENDS ${plover_SRCS} ${plover_HDRS}) - diff --git a/plover/Main.hs b/plover/Main.hs deleted file mode 100644 index 959768e0..00000000 --- a/plover/Main.hs +++ /dev/null @@ -1,18 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -import System.Environment - -import Plover.Types -import Plover.Compile - -import qualified AmbiguityTest - -units :: [CompilationUnit] -units = [AmbiguityTest.cu] - -main = do - args <- getArgs - case args of - [cdir, hdir] -> do - mapM_ (generateMain hdir cdir) units - _ -> error "Requires exactly two arguments: C and H file output directories" - diff --git a/plover/README b/plover/README deleted file mode 100644 index a55d77a3..00000000 --- a/plover/README +++ /dev/null @@ -1 +0,0 @@ -requires installation of https://github.com/swift-nav/plover for code generation diff --git a/plover/libswiftnav-generate.cabal b/plover/libswiftnav-generate.cabal deleted file mode 100644 index 8b0c72a4..00000000 --- a/plover/libswiftnav-generate.cabal +++ /dev/null @@ -1,14 +0,0 @@ --- Initial plover.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/ -name: libswiftnav-generate -version: 0.1.0.0 -author: Scott Kovach -maintainer: dskovach@gmail.com -build-type: Simple -cabal-version: >=1.10 - -executable plover - main-is: Main.hs - other-extensions: OverloadedStrings - build-depends: base >=4.7 && <4.8, plover - default-language: Haskell2010