#!/usr/bin/make -f
# -*- makefile -*-

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

export DEB_BUILD_HARDENING = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) -Wl,-z,now
export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
export CXXFLAGS += --std=c++17 -Wall -pthread -D_FORTIFY_SOURCE=2

export CXX = g++

export SKEL = /usr/share/flexc++

%:
	dh $@

override_dh_auto_build:
	./build program
	./build man
	./build manual
	dh_auto_build

override_dh_auto_clean:
	./build clean
	dh_auto_clean

override_dh_auto_install:
	./build install x debian/flexc++
	dh_installdocs README.class-setup
	dh_auto_install

#build: build-indep build-arch
#build-indep:
#build-arch: build-stamp
#build-stamp:
#        dh_testdir
#        # compile the package.
#        ./build program
#        ./build man
#        ./build manual
#        touch build-stamp
#
#clean:
#        dh_testdir
#        dh_testroot
#        rm -f build-stamp
#        ./build distclean
#        dh_clean
#
#install: build-arch
#        dh_testdir
#        dh_testroot
#        dh_prep
#        dh_installdirs
#
#        # Add here commands to install the package into debian/flexc++.
#        ./build install x debian/flexc++
#
#binary-indep:
#
#binary-arch: build-arch install
#        dh_testdir
#        dh_testroot
#        dh_installchangelogs
#        dh_installdocs README.class-setup
##       dh_installexamples
#        dh_installman
#        dh_link
#        dh_strip
#        dh_compress
#        dh_fixperms
#        dh_installdeb
#        dh_shlibdeps
#        dh_gencontrol
#        dh_md5sums
#        dh_builddeb
#
#binary: binary-indep binary-arch
#.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install
#
