File: rules

package info (click to toggle)
sparskit 2.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 4,348 kB
  • sloc: fortran: 15,253; makefile: 260; sh: 136; ansic: 76
file content (59 lines) | stat: -rwxr-xr-x 1,734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/make -f

PACKAGE=sparskit

DEB_SOURCE_PACKAGE:=$(PACKAGE)

STATIC_BUILD_PATH = DEB_build_static
SHARED_BUILD_PATH = DEB_build_shared


# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

get-orig-source:
	. debian/get-orig-source

CMAKE_FLAGS = -DCMAKE_INSTALL_PREFIX:PATH=/usr \
              -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" \
              -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed" \
              -DCMAKE_SKIP_RPATH:BOOL=ON

%:
	dh $@

override_dh_auto_configure:
	if [ ! -d $(STATIC_BUILD_PATH) ]; then mkdir $(STATIC_BUILD_PATH); fi
	cd $(STATIC_BUILD_PATH) \
            && cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON
	cd $(STATIC_BUILD_PATH) \
            && cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON

	if [ ! -d $(SHARED_BUILD_PATH) ]; then mkdir $(SHARED_BUILD_PATH); fi
	cd $(SHARED_BUILD_PATH) \
            && cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=OFF
	cd $(SHARED_BUILD_PATH) \
            && cmake $(CURDIR) $(CMAKE_FLAGS) -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=OFF

override_dh_auto_build:
	# build static libs
	$(MAKE) $(JOBS) -C $(STATIC_BUILD_PATH)

        # build shared libs and binaries
	$(MAKE) $(JOBS) -C $(SHARED_BUILD_PATH)

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# run a test
	./DEB_build_static/ITSOL/riters.ex
endif

override_dh_clean:
	rm -rf $(STATIC_BUILD_PATH)
	rm -rf $(SHARED_BUILD_PATH)
#	- rm libskit.a
	dh_clean

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp        install -C $(STATIC_BUILD_PATH)
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp/shared install -C $(SHARED_BUILD_PATH)