File: rules

package info (click to toggle)
micro-httpd 20140814-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 160 kB
  • sloc: ansic: 524; sh: 165; makefile: 101
file content (42 lines) | stat: -rwxr-xr-x 973 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

PACKAGE = micro-httpd
BIN	= micro_httpd
CC	= $(DEB_HOST_GNU_TYPE)-gcc

include debian/debian-vars.mk

export DEB_BUILD_MAINT_OPTIONS	= hardening=+all
export DEB_CFLAGS_MAINT_APPEND	= -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

man:
	# target: man -- convert *.pod to manual page
	$(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE) \
	MANSECT=8 makeman

override_dh_auto_build: man
	# Notify Makefile about compilation. We skip the *.o step.
	touch micro_httpd.o
	$(CC) $(CFLAGS) $(CPPFLAGS) micro_httpd.c $(LDFLAGS) -o $(BIN)

override_dh_auto_install:
	install -d -m 0755 $(SBINDIR) $(MAN8DIR)
	$(MAKE) install BINDIR=$(SBINDIR) MANDIR=$(MAN8DIR)

	# rename binary
	mv $(SBINDIR)/$(BIN) $(SBINDIR)/$(PACKAGE)

	# replace original manual page
	rm -f $(MAN8DIR)/*
	$(INSTALL_DATA) debian/*.8 $(MAN8DIR)

override_dh_installsystemd:
	dh_installsystemd micro-httpd\@.service micro-httpd.socket

%:
	dh $@

.PHONY: man

# End of file