File: Makefile

package info (click to toggle)
rxp 1.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 436 kB
  • ctags: 966
  • sloc: ansic: 9,679; makefile: 127; sh: 3
file content (111 lines) | stat: -rw-r--r-- 3,450 bytes parent folder | download | duplicates (2)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#VERSION=	1.2.3
MAJOR_VERSION= 1
MINOR_VERSION= 2.3
VERSION= $(MAJOR_VERSION).$(MINOR_VERSION)

CHAR_SIZE=16

DEBUG=		-g
CC=		gcc
GCCFLAGS=	-Wall -ansi -pedantic
CFLAGS=		$(GCCFLAGS) $(DEBUG) -O -DCHAR_SIZE=$(CHAR_SIZE)
LDFLAGS=	$(DEBUG)

.SUFFIXES: .lo

.c.lo:
	$(CC) $(CFLAGS) -fPIC -DPIC -c -o $@ $< >/dev/null 2>&1

# You may well have to change this line.  Just "LIBS=" will probably work.
#LIBS:sh=	[ -f /usr/lib/libsocket.a ] && echo "-lnsl -lsocket -ldl" || echo ""
LIBS=

STATIC=		xmlparser.o url.o charset.o string16.o ctype16.o dtd.o \
		input.o stdio16.o system.o hash.o version.o namespaces.o
SHARED=		xmlparser.lo url.lo charset.lo string16.lo ctype16.lo dtd.lo \
		input.lo stdio16.lo system.lo hash.lo version.lo namespaces.lo
SOURCES=	rxp.c xmlparser.c url.c charset.c string16.c ctype16.c dtd.c \
		input.c stdio16.c system.c hash.c version.c namespaces.c
INCLUDES=	xmlparser.h url.h charset.h string16.h ctype16.h dtd.h \
		input.h stdio16.h system.h hash.h version.h rxputil.h \
		namespaces.h

DOCS=		RELNOTES COPYRIGHT COPYING rxp.1 Manual Threads

DISTDIR=	/home/ftp/pub/richard

all:	librxp.a librxp.so rxp 

rxp:	rxp.o librxp.a
	$(CC) $(LDFLAGS) -o rxp rxp.o -L. -lrxp $(LIBS)

rxp-web:	rxp-web.o librxp.a
	$(CC) $(LDFLAGS) -o rxp-web rxp-web.o -L. -lrxp $(LIBS)

librxp.a:	$(STATIC)
	ar rv librxp.a $(STATIC)
	ranlib librxp.a

librxp.so: $(SHARED)
	gcc $(DEBUG) -shared -lc -Wl,-soname -Wl,librxp.so.$(MAJOR_VERSION) $(SHARED) -o librxp.so.$(VERSION)
	ln -s librxp.so.$(VERSION) librxp.so
	ln -s librxp.so.$(VERSION) librxp.so.$(MAJOR_VERSION)


rxp.o: rxp.c xmlparser.h input.h dtd.h charset.h stdio16.h string16.h
rxp-web.o: rxp-web.c xmlparser.h input.h dtd.h charset.h stdio16.h string16.h

xmlparser.o:	xmlparser.c xmlparser.h input.h dtd.h charset.h stdio16.h string16.h
xmlparser.lo:	xmlparser.c xmlparser.h input.h dtd.h charset.h stdio16.h string16.h

input.o:	input.c input.h dtd.h charset.h url.h stdio16.h
input.lo:	input.c input.h dtd.h charset.h url.h stdio16.h

dtd.o:		dtd.c dtd.h charset.h
dtd.lo:		dtd.c dtd.h charset.h

charset.o:	charset.c charset.h
charset.lo:	charset.c charset.h

stdio16.o:	stdio16.c stdio16.h charset.h
stdio16.lo:	stdio16.c stdio16.h charset.h

string16.o:	string16.c string16.h charset.h
string16.lo:	string16.c string16.h charset.h

system.o:	system.c system.h stdio16.h charset.h
system.lo:	system.c system.h stdio16.h charset.h

url.o:		url.c url.h stdio16.h
url.lo:		url.c url.h stdio16.h

hash.o:		hash.c hash.h charset.h string16.h
hash.lo:	hash.c hash.h charset.h string16.h

ctype16.o:	ctype16.c ctype16.h charset.h system.h
ctype16.lo:	ctype16.c ctype16.h charset.h system.h

namespaces.o:	namespaces.c namespaces.h charset.h rxputil.h charset.h string16.h
namespaces.lo:	namespaces.c namespaces.h charset.h rxputil.h charset.h string16.h

version.o:	version.c version.h
version.lo:	version.c version.h

backup:
	rm -f ../XML2.tar
	tar cfh ../XML2.tar *.[ch] Makefile

dist:
	rm -rf rxp-$(VERSION).tar.gz rxp-$(VERSION)
	mkdir rxp-$(VERSION)
	cp -p $(SOURCES) $(INCLUDES) Makefile $(DOCS) rxp-$(VERSION)
	tar cvf rxp-$(VERSION).tar rxp-$(VERSION)
	rm -rf rxp-$(VERSION)
	gzip -v rxp-$(VERSION).tar
clean:
	rm -f *.lo *.o *.a rxp librxp.so*

dist-install: dist
	mv rxp-$(VERSION).tar.gz $(DISTDIR)
	sed s/_VERSION_/$(VERSION)/ <rxp-release.xml | sed s/_DATE_/`date +%Y%m%d`/ >$(DISTDIR)/rxp-release.xml
	cd $(DISTDIR); rm rxp.tar.gz; ln -s rxp-$(VERSION).tar.gz rxp.tar.gz