carl9170 firmware: replace makefile with cmake
authorChristian Lamparter <chunkeey@googlemail.com>
Tue, 24 May 2011 22:38:14 +0000 (00:38 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Tue, 24 May 2011 22:47:29 +0000 (00:47 +0200)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/CMakeLists.txt [new file with mode: 0644]
config/Makefile [deleted file]

diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b230348
--- /dev/null
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(config)
+
+#set(CMAKE_VERBOSE_MAKEFILE ON)
+
+find_package(BISON REQUIRED)
+find_package(FLEX REQUIRED)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../include/generated")
+
+LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../extra")
+FIND_PACKAGE(GPERF REQUIRED) 
+
+BISON_TARGET(zconf zconf.y zconf.tab.c COMPILE_FLAGS "-l -b zconf -p zconf")
+FLEX_TARGET(zconfscan zconf.l lex.zconf.c COMPILE_FLAGS "-Pzconf -L")
+GPERF_TARGET(zconfhash zconf.gperf zconf.hash.c)
+
+SET(zconf_deps ${FLEX_zconfscan_OUTPUTS} ${GPERF_zconfhash_OUTPUTS})
+SET_SOURCE_FILES_PROPERTIES(${BISON_zconf_OUTPUTS}
+      PROPERTIES OBJECT_DEPENDS "${zconf_deps}")
+
+set(conf_src conf.c ${BISON_zconf_OUTPUTS}) 
+
+add_executable(conf ${conf_src})
diff --git a/config/Makefile b/config/Makefile
deleted file mode 100644 (file)
index c76a975..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# ===========================================================================
-# carl9170 configuration targets
-# These targets are used from top-level makefile
-
-PHONY += config
-
-config: conf
-
-# ===========================================================================
-# Shared Makefile for the various kconfig executables:
-
-clean:
-       @rm -f *.o zconf.tab.c lex.zconf.c zconf.hash.c lex.backup conf
-
-# generated files seem to need this to find local include files
-
-zconf.tab.o: lex.zconf.c zconf.hash.c
-
-zconf.tab.c: zconf.y
-lex.zconf.c: zconf.l
-zconf.hash.c: zconf.gperf
-
-%.tab.c: %.y
-       bison -l -b $* -p $(notdir $*) $<
-
-lex.%.c: %.l
-       flex -L -P$(notdir $*) -o$@ $<
-
-%.hash.c: %.gperf
-       gperf < $< > $@
-
-%.o: %.c
-       gcc $(CFLAGS) -I./ -c $< -o $@
-
-conf: zconf.tab.o conf.o