cp: define assert() macro
[hvf.git] / CMakeLists.txt
blob96a7298d31479928fb90397babf5569766bd4129
1 cmake_minimum_required(VERSION 2.8)
3 # we need to compile the build tools
4 include(ExternalProject)
5 ExternalProject_add(build
6         DOWNLOAD_COMMAND ""
7         SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build
8         CONFIGURE_COMMAND cmake <SOURCE_DIR>
9         INSTALL_COMMAND ""
10         BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/build
13 include(CMakeForceCompiler)
15 set(CMAKE_SYSTEM_NAME Linux)
16 enable_language(ASM-ATT)
18 set(CMAKE_LINKER "s390x-linux-ld")
19 set(CMAKE_OBJCOPY "s390x-linux-objcopy")
20 set(CMAKE_ASM "s390x-linux-as")
21 CMAKE_FORCE_C_COMPILER(s390x-linux-gcc GNU)
22 set(CMAKE_ASM-ATT_COMPILE_OBJECT
23         "${CMAKE_ASM} ${ASM_SYS_FLAGS} <FLAGS> -o <OBJECT> <SOURCE>")
25 set(CMAKE_C_FLAGS "-g -fno-strict-aliasing -fno-builtin -nostdlib -nostdinc -Wall -m64 -I ${PROJECT_SOURCE_DIR}/include/ -include ${PROJECT_SOURCE_DIR}/include/types.h -O2")
27 set(HVF_VERSION "0.16-rc3")
29 add_subdirectory(lib)
30 add_subdirectory(cp)
31 add_subdirectory(nss)
32 add_subdirectory(loader)
33 add_subdirectory(installer)
35 add_custom_command(
36         OUTPUT installer/archive.cpio
37         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/build/mkarchive
38                 ${CMAKE_CURRENT_SOURCE_DIR}/cp/config/hvf.directory text 80
39                 ${CMAKE_CURRENT_SOURCE_DIR}/cp/config/system.config text 80
40                 ${CMAKE_CURRENT_SOURCE_DIR}/cp/config/local-3215.txt text 80
41                 ${CMAKE_CURRENT_BINARY_DIR}/cp/hvf bin
42                 ${CMAKE_CURRENT_BINARY_DIR}/loader/eckd.rto bin
43                 ${CMAKE_CURRENT_BINARY_DIR}/loader/loader.rto bin
44                 ${CMAKE_CURRENT_SOURCE_DIR}/doc/installed_files.txt text 80
45                 ${CMAKE_CURRENT_BINARY_DIR}/nss/8ball/8ball bin
46                 > installer/archive.cpio
47         DEPENDS hvf 8ball loader-rto
49 add_custom_command(
50         OUTPUT installer.bin
51         COMMAND ./build/padcat installer/rdr.rto installer/installer.rto installer/archive.cpio > installer.bin
52         DEPENDS installer-rto installer/archive.cpio
55 add_custom_target(distro ALL DEPENDS installer.bin)