File: rules

package info (click to toggle)
lpc21isp 1.97-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 392 kB
  • ctags: 247
  • sloc: ansic: 3,370; makefile: 46
file content (32 lines) | stat: -rwxr-xr-x 1,179 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -n -e's/^Version: \(.*\)-[^-]\+/\1/p')
VERSION_WITHOUT_POINT := $(shell echo $(UPSTREAM_VERSION) | tr -d ".")
export BUILD_TIME = $(shell LC_ALL=C date -u --date="`dpkg-parsechangelog -SDate`" +'%H:%M:%S')
export BUILD_DATE = $(shell LC_ALL=C date -u --date="`dpkg-parsechangelog -SDate`" +'%b\ %e\ %Y')
CFLAGS := $(CFLAGS) -D__DATE__=\"$(BUILD_DATE)\" -D__TIME__=\"$(BUILD_TIME)\"

%:
	dh $@

override_dh_auto_clean:
	make clean

override_dh_auto_build:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lpc21isp lpc21isp.c adprog.c lpcprog.c lpcterm.c

override_dh_installchangelogs:
	dh_installchangelogs debian/lpc21isp.changelog.upstream

get-orig-source:
		@if [ ! -d "debian" ] ; then \
			echo 'Run this from the top directory of the Debian source' >&2; \
			exit 1; \
		fi
		wget http://sourceforge.net/projects/lpc21isp/files/lpc21isp/$(UPSTREAM_VERSION)/lpc21isp_$(VERSION_WITHOUT_POINT).tar.gz/download -O ../lpc21isp_$(UPSTREAM_VERSION).orig.tar.gz;