File: Makefile

package info (click to toggle)
prips 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 432 kB
  • sloc: ansic: 393; sh: 388; makefile: 74
file content (85 lines) | stat: -rw-r--r-- 2,257 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# SPDX-FileCopyrightText: 2001-2003  Daniel Kelly
# SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
# SPDX-License-Identifier: GPL-2.0-or-later

PROG=		prips

LOCALBASE?=	/usr/local
PREFIX?=	${LOCALBASE}
BINDIR?=	${PREFIX}/bin
DOCSDIR?=	${PREFIX}/share/doc/${PROG}
EXAMPLESDIR?=	${DOCSDIR}/examples

CPPFLAGS_STD?=	-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
CPPFLAGS+=	${CPPFLAGS_STD}

CFLAGS_OPT?=	-O2
CFLAGS_DBG?=	-g
CFLAGS_WARN?=	-Wall -W -std=c99 -pedantic -Wbad-function-cast -Wcast-align \
		-Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes \
		-Wnested-externs -Wpointer-arith -Wshadow \
		-Wstrict-prototypes -Wwrite-strings \
		-Wno-format-y2k -Winline -Wno-pointer-sign \
		-Wreturn-type -Wswitch -Wunused-parameter

CFLAGS?=	${CFLAGS_OPT} ${CFLAGS_DBG}
CFLAGS+=	${CFLAGS_WARN}

CC?=gcc
LIBS?=
MKDIR?=		mkdir -p
RM?=rm -f
GZIP?=		gzip -c9
FALSE?=		false
INSTALL?=	install

# Keep this uncommented if you are building prips on a POSIX-compatible
# system.  If you are not sure, chances are that you most probably are.
CFLAGS+=	-DHAVE_POSIX
# Keep this uncommented if your header files provide a definition for
# the POSIX-compatible 32-bit unsigned integer type
CFLAGS+=	-DHAVE_UINT32_T
# If you do NOT have the POSIX-compatible uint32_t type, please specify
# which of the integer types on your platform is 32-bits wide
#CFLAGS+=	-DINT32_T=int

BINOWN?=	root
BINGRP?=	root
BINMODE?=	755

SHAREOWN?=	${BINOWN}
SHAREGRP?=	${BINGRP}
SHAREMODE?=	644

STRIP?=		-s

INSTALL_PROGRAM?=	${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
INSTALL_DATA?=		${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}

all: ${PROG}

${PROG}: main.o prips.o except.o
	$(CC) $(LDFLAGS) -o prips main.o prips.o except.o $(LIBS)

main.o: main.c prips.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -c main.c

prips.o: prips.c prips.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c prips.c 

except.o: except.c except.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -c except.c

clean:	
	$(RM) core *~ *.o ${PROG}

test:	all
	prove ../t

install:	all
	${MKDIR} ${DESTDIR}${BINDIR}
	${INSTALL_PROGRAM} ${PROG} ${DESTDIR}${BINDIR}/
	${MKDIR} ${DESTDIR}${EXAMPLESDIR}/tests
	${INSTALL_DATA} ../t/*.t ../t/tap-functions.sh ${DESTDIR}${EXAMPLESDIR}/tests/

.PHONY:	all clean test install