kopia lustrzana https://github.com/stlink-org/stlink
debian: Remove all useless stuff from debian/rules, force cmake buildsystem
The top-level makefile that was used to drive cmake broke the autodetection of the used buildsystem by debhelper. This commit fixes it and moves most of the installation stuff to CMakeLists.txt to keep debian/ folder contents to the bare minimum. Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>pull/485/head
rodzic
ee3f7a1cf1
commit
650a88aa2c
|
@ -127,6 +127,14 @@ install(TARGETS st-flash st-info
|
|||
RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
|
||||
install(FILES etc/modprobe.d/stlink_v1.conf
|
||||
DESTINATION /etc)
|
||||
install(FILES ${RULES_FILES}
|
||||
DESTINATION /lib/udev/rules.d/)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src/gdbserver)
|
||||
add_subdirectory(src/tools/gui)
|
||||
|
||||
|
|
4
Makefile
4
Makefile
|
@ -27,6 +27,10 @@ release: build/Release
|
|||
@echo "[RELEASE]"
|
||||
@$(MAKE) -C build/Release
|
||||
|
||||
package: build/Release
|
||||
@echo "[PACKAGE] Release"
|
||||
@$(MAKE) -C build/Release package
|
||||
|
||||
test: debug
|
||||
@$(MAKE) -C build/Debug test
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
|||
set (CPACK_SOURCE_GENERATOR "TBZ2;ZIP")
|
||||
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
set (CPACK_SET_DESTDIR "ON")
|
||||
set (CPACK_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/cpack/staging")
|
||||
if (APPLE)
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/osx")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
usr/include/*
|
||||
usr/lib/*/lib*.a
|
||||
usr/lib/*/pkgconfig/*
|
||||
usr/lib/*/lib*.so
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
usr/lib/*/lib*.so*
|
||||
usr/lib/*/lib*.so.*
|
||||
lib/udev/rules.d/*.rules
|
||||
lib/modprobe.d/*.conf
|
||||
etc/modprobe.d/*.conf
|
||||
|
|
|
@ -16,42 +16,12 @@ include /usr/share/dpkg/default.mk
|
|||
# package maintainers to append LDFLAGS
|
||||
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
|
||||
# main packaging script based on dh7 syntax
|
||||
%:
|
||||
dh $@
|
||||
|
||||
|
||||
OUTDIR=build/Release
|
||||
ROOTDIR=debian/tmp
|
||||
DSTDIR=$(ROOTDIR)/usr
|
||||
BINDIR=$(DSTDIR)/bin
|
||||
SHAREDIR=$(DSTDIR)/share/stlink
|
||||
LIBDIR=$(DSTDIR)/lib/$(if $(DEB_TARGET_MULTIARCH),$(DEB_TARGET_MULTIARCH),$(DEB_BUILD_MULTIARCH))
|
||||
UDEVDIR=$(ROOTDIR)/lib/udev/rules.d/
|
||||
MODDIR=$(ROOTDIR)/lib/modprobe.d/
|
||||
|
||||
export CMAKEFLAGS = \
|
||||
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
|
||||
dh $@ --buildsystem cmake
|
||||
|
||||
# debmake generated override targets
|
||||
# This is example for Cmake (See http://bugs.debian.org/641051 )
|
||||
override_dh_auto_configure:
|
||||
|
||||
override_dh_auto_install:
|
||||
install -d $(DSTDIR)/include/stlink/tools
|
||||
install -d $(LIBDIR)/pkgconfig
|
||||
install -d $(BINDIR)
|
||||
install -d $(SHAREDIR)
|
||||
install -d $(UDEVDIR)
|
||||
install -d $(MODDIR)
|
||||
install -m644 $(wildcard include/*.h) $(DSTDIR)/include
|
||||
install -m644 $(wildcard include/stlink/*.h) $(DSTDIR)/include/stlink
|
||||
install -m644 $(wildcard include/stlink/tools/*.h) $(DSTDIR)/include/stlink/tools
|
||||
install -m755 $(wildcard $(OUTDIR)/st-* $(OUTDIR)/src/gdbserver/st-* $(OUTDIR)/src/tools/gui/stlink-gui*) $(BINDIR)
|
||||
cp -d $(wildcard $(OUTDIR)/libstlink.*) $(LIBDIR)
|
||||
install -m644 $(OUTDIR)/usr/lib/pkgconfig/stlink.pc $(LIBDIR)/pkgconfig
|
||||
install -m644 src/tools/gui/stlink-gui.ui $(SHAREDIR)
|
||||
install -m644 etc/udev/rules.d/*.rules $(UDEVDIR)
|
||||
install -m644 etc/modprobe.d/*.conf $(MODDIR)
|
||||
|
||||
dh_auto_configure -- \
|
||||
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/usr/bin/stlink-gui*
|
||||
/usr/share/*
|
||||
/usr/share/stlink/stlink-gui.ui
|
||||
|
|
Ładowanie…
Reference in New Issue