summaryrefslogtreecommitdiff
path: root/pkgtools/libnbcompat/files/Makefile.in
blob: 0ac426a02cfa29b9bf65808a9fa6d1693543e4a7 (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
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
86
87
88
89
90
91
# $NetBSD: Makefile.in,v 1.26 2004/08/21 06:36:13 jlam Exp $
#

srcdir=		@srcdir@
prefix= 	@prefix@
VPATH=		@srcdir@
SHELL=		/bin/sh

CC=		@CC@
CFLAGS=		-I$(srcdir) -I. @INCLUDES@ @CFLAGS@
CPPFLAGS=	@CPPFLAGS@
DEFS=		@DEFS@
INSTALL=	@INSTALL@
LDFLAGS=	@LDFLAGS@

AWK=		@AWK@
AR=		@AR@
RANLIB=		@RANLIB@

LIB=		libnbcompat.a

INCS=		nbcompat.h \
		nbcompat/err.h \
		nbcompat/fnmatch.h \
		nbcompat/fts.h \
		nbcompat/getopt.h \
		nbcompat/glob.h \
		nbcompat/grp.h \
		nbcompat/limits.h \
		nbcompat/md5.h \
		nbcompat/nbconfig.h \
		nbcompat/nbtypes.h \
		nbcompat/paths.h \
		nbcompat/poll.h \
		nbcompat/pwd.h \
		nbcompat/queue.h \
		nbcompat/regex.h \
		nbcompat/rmd160.h \
		nbcompat/sha1.h \
		nbcompat/stat.h \
		nbcompat/statvfs.h \
		nbcompat/stdio.h \
		nbcompat/stdlib.h \
		nbcompat/string.h \
		nbcompat/time.h \
		nbcompat/tzfile.h \
		nbcompat/unistd.h \
		nbcompat/util.h \
		nbcompat/vis.h

# always use our local glob() implementation.
OBJS=		glob.o @LIBOBJS@

LINK=		$(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
COMPILE=	$(CC) $(CPPFLAGS) $(CFLAGS)

all: nbcompat/nbtypes.h nbcompat/nbconfig.h $(LIB)

.c.o: nbcompat/nbtypes.h
	$(COMPILE) $(DEFS) -c $<

$(LIB): $(OBJS)
	$(AR) cr $@ $(OBJS)
	$(RANLIB) $@

nbcompat/nbconfig.h: nbcompat/config.h nbcompat.awk
	$(AWK) -f nbcompat.awk nbcompat/config.h > $@

nbcompat/nbtypes.h: bits
	./bits $@

bits: bits.c
	$(CC) -o bits bits.c

install:
	$(INSTALL) -m 755 -d $(prefix)/lib
	$(INSTALL) -m 555 ${LIB} $(prefix)/lib
	$(RANLIB) $(prefix)/lib/$(LIB)
	$(INSTALL) -m 755 -d $(prefix)/include
	$(INSTALL) -m 755 -d $(prefix)/include/nbcompat
	@for file in $(INCS); do \
		echo "$(INSTALL) -m 444 $$file $(prefix)/include/$$file"; \
		$(INSTALL) -m 444 $$file $(prefix)/include/$$file; \
	done

clean:
	rm -f *.a *.o bits nbcompat/nbtypes.h nbcompat/nbcompat.h

distclean: clean
	rm -f Makefile config.log config.status configure.lineno
	rm -f nbcompat/config.h nbcompat/nbconfig.h