1 cmake_minimum_required(VERSION 2.8)
5 include("../extra/sh-elf-linux.cmake")
6 include("../config.cmake")
8 set(CARLFW_CFLAGS_WARNING "-W -Wall -Wextra -Wunreachable-code -Winline -Wlogical-op -Wno-packed-bitfield-compat -Winit-self -Wshadow -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wformat=2 -Wcast-align -Wmissing-format-attribute -Wmissing-prototypes -Wtype-limits -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -Wnested-externs -Wdisabled-optimization -Wpointer-arith -Wvolatile-register-var -Waddress -Wbad-function-cast -Wunsafe-loop-optimizations")
9 set(CARLFW_CFLAGS_EXTRA "-mbitops -std=gnu99 -ffunction-sections")
11 if (CONFIG_CARL9170FW_AGGRESSIVE_CFLAGS)
12 set(CARLFW_CFLAGS_AGGRESSIVE "-fomit-frame-pointer -fsee -frename-registers -ftree-vectorize")
13 endif (CONFIG_CARL9170FW_AGGRESSIVE_CFLAGS)
15 include_directories (../include/linux ../include/shared ../include include)
17 set(carl9170_main_src src/main.c src/timer.c src/wlan.c src/fw.c src/gpio.c
18 src/cmd.c src/uart.c src/dma.c src/hostif.c src/reboot.S
19 src/printf.c src/rf.c src/cam.c)
21 set(carl9170_lib_src src/ashlsi3.S src/memcpy.S src/memset.S)
22 set(carl9170_usb_src usb/main.c usb/usb.c usb/fifo.c)
24 set(carl9170_src ${carl9170_main_src} ${carl9170_lib_src} ${carl9170_usb_src})
26 set_source_files_properties(src/ashlsi3.S PROPERTIES LANGUAGE C)
27 set_source_files_properties(src/memcpy.S PROPERTIES LANGUAGE C)
28 set_source_files_properties(src/memset.S PROPERTIES LANGUAGE C)
29 set_source_files_properties(src/reboot.S PROPERTIES LANGUAGE C)
31 add_executable(carl9170.elf ${carl9170_src})
33 set_target_properties(carl9170.elf PROPERTIES LINKER_LANGUAGE C)
35 set_target_properties(carl9170.elf PROPERTIES COMPILE_FLAGS
36 "${CARLFW_CFLAGS_EXTRA} ${CARLFW_CFLAGS_AGGRESSIVE} ${CARLFW_CFLAGS_WARNING}")
37 set_target_properties(carl9170.elf PROPERTIES LINK_FLAGS "-Tcarl9170.lds")
41 ${OBJCOPY} --strip-unneeded -O binary -R .sram -R .eeprom -R .fwdsc carl9170.elf carl9170.fw
47 ${OBJCOPY} --strip-unneeded -O binary -j .fwdsc carl9170.elf carl9170.dsc