File: MakeLib

package info (click to toggle)
inn2 2.2.2.2000.01.31-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,424 kB
  • ctags: 5,722
  • sloc: ansic: 61,219; perl: 9,939; sh: 5,644; makefile: 1,695; awk: 1,567; yacc: 1,548; lex: 249; tcl: 3
file content (87 lines) | stat: -rwxr-xr-x 2,133 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
86
87
#! /bin/sh
##  $Revision: 1.3 $
##  Script to build an easy-to-ship single directory that contains
##  everything needed to build NNTP clientlib emulation on a machine.

##  Optional first argument is the destination architecture, like "sun4"
DIR=nntplib.${1-dist}
if [ -d ${DIR} ] ; then
    echo ${DIR} exists!
    exit 1
fi
mkdir ${DIR}

##  Copy the files.
for I in \
	config/subst.c config/subst.sh config/config.data \
	doc/inn.conf.5 \
	include/clibrary.h include/configdata.h include/libinn.h \
	include/macros.h include/mystring.h include/mymemory.h \
	include/myserver.h include/nntp.h include/paths.h \
	lib/clientlib.c lib/getconfig.c lib/getfqdn.c lib/remopen.c \
	site/inn.conf ; do \
    cp $I ${DIR}
done

##  Write the Makefile.  We duplicate the RCS revision string of the
##  script into the Makefile on purpose.
cat <<\EOF >${DIR}/Makefile
##  $Revision: 1.3 $
SHELL	= /bin/sh
MAKE	= make

##  Configuration dependencies -- edit as appropriate
DEFS	=
CFLAGS	= $(DEFS) -g
LDFLAGS	= -Bstatic
RANLIB	= ranlib

##  Manual pages -- install as appropriate for your system
DOC	= inn.conf.5

##  Configuration files -- install in /usr/lib/news
CONF	= inn.conf

##  Program sources
SOURCES = clientlib.c getconfig.c getfqdn.c remopen.c
OBJECTS = clientlib.o getconfig.o getfqdn.o remopen.o
HEADERS	= clibrary.h configdata.h libinn.h macros.h nntp.h paths.h

##  First target, just compile everything.
all:			libinn.a $(DOC) $(CONF)
	date >$@

install:		libinn.a
	-date >$@

clobber clean:
	rm -f foo core tags a.out *.o
	rm -f libinn.a
	rm -f all install

libinn.a:		$(OBJECTS)
	ar r $@ $(OBJECTS)
	$(RANLIB) $@

subst:		subst.c subst.sh
	make c || make sh || { rm -f subst ; echo Failed 1>&2 ; }

config:		subst config.data $(DOC) $(HEADERS) Makefile
	./subst -f config.data $(DOC) $(HEADERS) Makefile
	date >config

c:
	@rm -f subst
	$(CC) -o subst subst.c
sh:
	@rm -f subst
	cp subst.sh subst
	chmod +x subst

##  Dependencies.  Default list, below, is probably good enough.
depend:		Makefile $(SOURCES)
	makedepend $(DEFS) $(SOURCES)

# DO NOT DELETE THIS LINE -- make depend depends on it.
$(OBJECTS):	$(HEADERS)
EOF