debian/rules
author Edouard Tisserant
Thu, 24 Jan 2019 13:53:01 +0100
changeset 808 de1fc3261f21
parent 612 fc3399727a06
permissions -rwxr-xr-x
Adding -fPIC isn't necessary of xeno-config is set correctly. Backed out changeset b9f1fcda7d30
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     1
#!/usr/bin/make -f
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     2
# -*- makefile -*-
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     3
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     4
# Uncomment this to turn on verbose mode.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     5
export DH_VERBOSE=1
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     6
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     7
# This has to be exported to make some magic below work.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     8
export DH_OPTIONS
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
     9
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    10
CFLAGS = -Wall -g
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    11
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    12
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    13
	CFLAGS += -O0
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    14
else
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    15
	CFLAGS += -O2
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    16
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    17
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    18
config.status: configure
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    19
	#### CONFIG.STATUS ####	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    20
	dh_testdir
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    21
	
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    22
	# Add here commands to configure the package.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    23
	cp debian/control-$(shell echo $(CAN_INTERFACE)) debian/control; \
612
fc3399727a06 Fix some bug in debian packages
greg
parents: 553
diff changeset
    24
	./configure --can=$(shell echo $(CAN_INTERFACE)) --prefix=/usr --wx=0
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    25
	 
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    26
build: build-indep
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    27
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    28
build-indep: build-indep-stamp
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    29
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    30
build-indep-stamp:  config.status
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    31
	#### BUILD-INDEP-STAMP ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    32
	# Add here commands to compile the indep part of the package.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    33
	$(MAKE)
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    34
	
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    35
clean:
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    36
	#### CLEAN ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    37
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    38
	dh_testroot
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    39
	rm -f build-indep-stamp #CONFIGURE-STAMP#
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    40
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    41
	# Add here commands to clean up after the build process.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    42
	-$(MAKE) clean
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    43
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    44
	cp -f /usr/share/misc/config.sub config.sub
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    45
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    46
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    47
	cp -f /usr/share/misc/config.guess config.guess
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    48
endif
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    49
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    50
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    51
	dh_clean 
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    52
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    53
install: install-indep install-arch
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    54
install-indep:
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    55
	#### INSTALL-INDEP ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    56
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    57
	dh_testroot
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    58
	dh_clean -k -i 
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    59
	dh_installdirs -i
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    60
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    61
	# Add here commands to install the indep part of the package into
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    62
	# debian/<package>-doc.
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    63
	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    64
	$(MAKE) -C src PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    65
	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    66
	$(MAKE) -C examples PREFIX=$(CURDIR)/debian/canfestival/usr install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    67
	$(MAKE) -C objdictgen PREFIX=$(CURDIR)/debian/canfestival/usr/share/CanFestival-3 install
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    68
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    69
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    70
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    71
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    72
	cp -a $(CURDIR)/debian/canfestival/usr/include/canfestival/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    73
	cp -a $(CURDIR)/debian/canfestival/usr/lib/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    74
	cp -a $(CURDIR)/debian/canfestival/usr/lib/libcanfestival_unix.a $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    75
	cp $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config.py $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py 
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    76
	
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    77
	mkdir -p $(CURDIR)/debian/canfestival/usr/share/applications
553
e411fab0f72d removed dead hidden files
'Gr?gory Tr?lat <gregory.trelat@lolitech.fr>'
parents: 531
diff changeset
    78
	cp objdictgen/networkedit.ico $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen
e411fab0f72d removed dead hidden files
'Gr?gory Tr?lat <gregory.trelat@lolitech.fr>'
parents: 531
diff changeset
    79
	cp objdictgen/networkedit.png $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen	
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
    80
	cp debian/objdictedit.desktop $(CURDIR)/debian/canfestival/usr/share/applications/objdictedit.desktop
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    81
	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    82
	dh_install -i --sourcedir=debian/canfestival
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    83
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    84
binary-common:
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    85
	#### BINARY-COMMON ####
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    86
	dh_testdir
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    87
	dh_testroot
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    88
	dh_installchangelogs CHANGES
612
fc3399727a06 Fix some bug in debian packages
greg
parents: 553
diff changeset
    89
#	dh_installdocs
346
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    90
#	dh_installexamples
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    91
#	dh_installmenu
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    92
#	dh_installdebconf	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    93
#	dh_installlogrotate	
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    94
#	dh_installemacsen
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    95
#	dh_installpam
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    96
#	dh_installmime
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    97
#	dh_python
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    98
#	dh_installinit
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
    99
#	dh_installcron
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   100
#	dh_installinfo
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   101
#	dh_installman
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   102
	dh_link
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   103
	dh_strip
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   104
	dh_compress
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   105
	dh_fixperms
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   106
#	dh_perl
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   107
#	dh_makeshlibs
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   108
	dh_installdeb
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   109
#	dh_shlibdeps -l /usr/lib
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   110
	dh_gencontrol
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   111
	dh_md5sums
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   112
	dh_builddeb
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   113
# Build architecture independant packages using the common target.
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   114
binary-indep: build-indep install-indep
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   115
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
59dbdcc99264 add debian directory to create debian binary packages
greg
parents:
diff changeset
   116
531
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
   117
binary: binary-indep
f912f8d26e98 updated : debian package scripts
greg
parents: 373
diff changeset
   118
.PHONY: build clean binary-indep binary install install-indep