libplatforminfo: unify target implementations

Don't require a file for each subtarget, fall back to default.c.
This commit is contained in:
Matthias Schiffer 2017-02-12 05:59:16 +01:00
parent 036ad3e51e
commit ee064ae430
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
17 changed files with 10 additions and 15 deletions

View File

@ -18,7 +18,6 @@ define Package/libplatforminfo
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Platform information library
DEPENDS:=@(TARGET_ar71xx_generic||TARGET_ar71xx_mikrotik||TARGET_ar71xx_nand||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_x86_geode||TARGET_x86_64||TARGET_ramips_mt7621||TARGET_ramips_mt7628||TARGET_ramips_rt305x||TARGET_brcm2708_bcm2708||TARGET_brcm2708_bcm2709||TARGET_sunxi||TARGET_mvebu)
endef
CMAKE_OPTIONS += \

View File

@ -20,9 +20,18 @@ else(SUBTARGET)
add_definitions(-DTARGET_${TARGET})
endif(SUBTARGET)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/targets/${FULL_TARGET}.c")
set(TARGET_SOURCE "targets/${FULL_TARGET}.c")
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/targets/${TARGET}.c")
set(TARGET_SOURCE "targets/${TARGET}.c")
else()
set(TARGET_SOURCE "targets/default.c")
endif()
add_library(platforminfo SHARED
common.c
targets/${FULL_TARGET}.c
${TARGET_SOURCE}
)
set_target_properties(platforminfo PROPERTIES
COMPILE_FLAGS "-Wall -std=c99 -D_GNU_SOURCE"

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/default.c

View File

@ -1 +0,0 @@
template/x86.c

View File

@ -1 +0,0 @@
template/x86.c

View File

@ -1 +0,0 @@
template/x86.c