summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/add/Makefile.in
blob: 9185cd769b32ad4e85f7cddc8f27b0ac9c20c772 (plain)
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
# $NetBSD: Makefile.in,v 1.26 2012/05/15 16:43:53 christos Exp $

srcdir=		@srcdir@

prefix=		@prefix@
exec_prefix=	@exec_prefix@
sbindir=	@sbindir@
mandir=		@mandir@
datarootdir=	@datarootdir@

man1dir=	$(mandir)/man1
cat1dir=	$(mandir)/cat1

CC=		@CC@
CCLD=		$(CC)
CPPFLAGS=	@CPPFLAGS@ -I. -I$(srcdir) -I../lib
DEFS=		@DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DMACHINE_ARCH=\"$(MACHINE_ARCH)\" -DBINDIR=\"$(sbindir)\"
CFLAGS=		@CFLAGS@
LDFLAGS=	@LDFLAGS@ -L../lib

SSL_SUPPORT=	@ssl_support@

LIBS=		-linstall -lfetch
.if !empty(SSL_SUPPORT)
LIBS+=		-lcrypto
.endif
LIBS+=		@LIBS@

INSTALL=	@INSTALL@

PROG=		pkg_add

OBJS=	main.o perform.o

all: $(PROG)

.c.o:
	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $<

$(PROG): $(OBJS)
	$(CCLD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

clean:
	rm -f $(OBJS) $(PROG)

install:
	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
.if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
.endif