greg@346: #!/usr/bin/make -f
greg@346: # -*- makefile -*-
greg@346: 
greg@346: # Uncomment this to turn on verbose mode.
greg@346: export DH_VERBOSE=1
greg@346: 
greg@346: # This has to be exported to make some magic below work.
greg@346: export DH_OPTIONS
greg@346: 
greg@346: CFLAGS = -Wall -g
greg@346: 
greg@346: ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
greg@346: 	CFLAGS += -O0
greg@346: else
greg@346: 	CFLAGS += -O2
greg@346: endif
greg@346: 
greg@346: config.status: configure
greg@346: 	#### CONFIG.STATUS ####	
greg@346: 	dh_testdir
greg@531: 	
greg@346: 	# Add here commands to configure the package.
greg@531: 	cp debian/control-$(shell echo $(CAN_INTERFACE)) debian/control; \
greg@612: 	./configure --can=$(shell echo $(CAN_INTERFACE)) --prefix=/usr --wx=0
greg@531: 	 
greg@531: build: build-indep
greg@346: 
greg@346: build-indep: build-indep-stamp
greg@531: 
greg@346: build-indep-stamp:  config.status
greg@346: 	#### BUILD-INDEP-STAMP ####
greg@346: 	# Add here commands to compile the indep part of the package.
greg@531: 	$(MAKE)
greg@531: 	
greg@531: clean:
greg@346: 	#### CLEAN ####
greg@346: 	dh_testdir
greg@346: 	dh_testroot
greg@531: 	rm -f build-indep-stamp #CONFIGURE-STAMP#
greg@346: 
greg@346: 	# Add here commands to clean up after the build process.
greg@346: 	-$(MAKE) clean
greg@346: ifneq "$(wildcard /usr/share/misc/config.sub)" ""
greg@346: 	cp -f /usr/share/misc/config.sub config.sub
greg@346: endif
greg@346: ifneq "$(wildcard /usr/share/misc/config.guess)" ""
greg@346: 	cp -f /usr/share/misc/config.guess config.guess
greg@346: endif
greg@346: 
greg@346: 
greg@346: 	dh_clean 
greg@346: 
greg@346: install: install-indep install-arch
greg@346: install-indep:
greg@346: 	#### INSTALL-INDEP ####
greg@346: 	dh_testdir
greg@346: 	dh_testroot
greg@346: 	dh_clean -k -i 
greg@346: 	dh_installdirs -i
greg@346: 
greg@346: 	# Add here commands to install the indep part of the package into
greg@346: 	# debian/<package>-doc.
greg@531: 	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
greg@531: 	$(MAKE) -C src PREFIX=$(CURDIR)/debian/canfestival/usr install
greg@531: 	$(MAKE) -C drivers PREFIX=$(CURDIR)/debian/canfestival/usr install
greg@531: 	$(MAKE) -C examples PREFIX=$(CURDIR)/debian/canfestival/usr install
greg@531: 	$(MAKE) -C objdictgen PREFIX=$(CURDIR)/debian/canfestival/usr/share/CanFestival-3 install
greg@531: 
greg@531: 	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
greg@531: 	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
greg@531: 	mkdir -p $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
greg@531: 	cp -a $(CURDIR)/debian/canfestival/usr/include/canfestival/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/include
greg@531: 	cp -a $(CURDIR)/debian/canfestival/usr/lib/* $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/src
greg@531: 	cp -a $(CURDIR)/debian/canfestival/usr/lib/libcanfestival_unix.a $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/drivers/unix
greg@531: 	cp $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config.py $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py 
greg@531: 	
greg@531: 	mkdir -p $(CURDIR)/debian/canfestival/usr/share/applications
gregory@553: 	cp objdictgen/networkedit.ico $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen
gregory@553: 	cp objdictgen/networkedit.png $(CURDIR)/debian/canfestival/usr/share/CanFestival-3/objdictgen	
greg@531: 	cp debian/objdictedit.desktop $(CURDIR)/debian/canfestival/usr/share/applications/objdictedit.desktop
greg@346: 	
greg@346: 	dh_install -i --sourcedir=debian/canfestival
greg@346: 
greg@346: binary-common:
greg@346: 	#### BINARY-COMMON ####
greg@346: 	dh_testdir
greg@346: 	dh_testroot
greg@346: 	dh_installchangelogs CHANGES
greg@612: #	dh_installdocs
greg@346: #	dh_installexamples
greg@346: #	dh_installmenu
greg@346: #	dh_installdebconf	
greg@346: #	dh_installlogrotate	
greg@346: #	dh_installemacsen
greg@346: #	dh_installpam
greg@346: #	dh_installmime
greg@346: #	dh_python
greg@346: #	dh_installinit
greg@346: #	dh_installcron
greg@346: #	dh_installinfo
greg@346: #	dh_installman
greg@346: 	dh_link
greg@346: 	dh_strip
greg@346: 	dh_compress
greg@346: 	dh_fixperms
greg@346: #	dh_perl
greg@346: #	dh_makeshlibs
greg@346: 	dh_installdeb
greg@346: #	dh_shlibdeps -l /usr/lib
greg@346: 	dh_gencontrol
greg@346: 	dh_md5sums
greg@346: 	dh_builddeb
greg@346: # Build architecture independant packages using the common target.
greg@346: binary-indep: build-indep install-indep
greg@346: 	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
greg@346: 
greg@531: binary: binary-indep
greg@531: .PHONY: build clean binary-indep binary install install-indep