File: Makefile

package info (click to toggle)
mpt-status 1.2.0-8
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 604 kB
  • ctags: 4,301
  • sloc: ansic: 5,154; sh: 156; makefile: 46
file content (46 lines) | stat: -rw-r--r-- 1,143 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PROG		:= mpt-status
PREFIX		:= /usr
KERNEL_PATH	:= /usr/src/linux
KERNEL_PATH_B	:= /lib/modules/`uname -r`/build
KERNEL_PATH_S	:= /lib/modules/`uname -r`/source
CFLAGS		:= $(shell dpkg-buildflags --get CFLAGS) \
			-I${KERNEL_PATH}/drivers/message/fusion \
			-I${KERNEL_PATH_B}/drivers/message/fusion \
			-I${KERNEL_PATH_S}/drivers/message/fusion
DFLAGS		:= $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS		:= $(shell dpkg-buildflags --get LDFLAGS)
DESTDIR		:=
MANDIR		:= /usr/share/man
CC		:= gcc
INSTALL		:= install -D
ARCH		:= $(shell uname -m)

ifeq "${ARCH}" "sparc64"
	CFLAGS	:= -Iincl -Wall -W -O2 -m64 -pipe \
			-mcpu=ultrasparc -mcmodel=medlow
endif

${PROG}: ${PROG}.c ${PROG}.h
	${CC} ${DFLAGS} ${CFLAGS} -o $@ $< ${LDFLAGS}

install: ${PROG}
	${INSTALL} -s -o root -g root -m 0500 $< \
		${DESTDIR}${PREFIX}/sbin

install_doc: man/${PROG}.8
	${INSTALL} -o root -g root -m 0644 $< \
		${DESTDIR}${MANDIR}/man8
	gzip -9 ${DESTDIR}${MANDIR}/man8/${PROG}.8

uninstall:
	\rm -f ${DESTDIR}${PREFIX}/sbin/${PROG}

uninstall_doc:
	\rm -f ${DESTDIR}${MANDIR}/man8/${PROG}.8.gz

clean:
	\rm -f ${PROG}

distclean: clean
	\rm -f core* *~