-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·122 lines (94 loc) · 2.3 KB
/
Makefile
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
112
113
114
115
116
117
118
119
120
121
122
#
# Makefile for http-tiny
# written by L. Demailly
#
# (c)1998 Laurent Demailly
# (c)1996 Observatoire de Paris
#
# $Id: Makefile,v 1.2 1998/09/23 06:17:55 dl Exp $
#
#
# Check the following :
prefix=/usr/local
# where to install executable
BINDIR=$(prefix)/bin
# where to put man pages
MANDIR=$(prefix)/man
# where to put lib
LIBDIR=$(prefix)/lib
# where to put include
INCDIR=$(prefix)/include
# Your compiler
CC = gcc
# Compile flags
CDEBUGFLAGS = -O -Wmissing-prototypes -Wall -ansi -pedantic
#CDEBUGFLAGS = -O
# defines (needed for string ops on linux2/glibc for instance):
DEFINES= -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
# for HPUX (ansi)
#DEFINES= -D_HPUX_SOURCE
# for solaris some defines are needed for strncmp,... but can't find the good
# one... maybe the one above (for linux) work too, I haven't checked yet.
#DEFINES= -D
# others, may need something...
# Solaris
#SYSLIBS= -lsocket -lnsl
#INCLPATH =
# mostly standard
RM= rm -f
CP = cp -f
CHMOD= chmod
MKDIR= mkdir -p
AR = ar
RANLIB = ranlib
TAR= gtar
# no edit should be needed below...
CFLAGS = $(CDEBUGFLAGS) $(INCLPATH) $(DEFINES)
LDFLAGS= $(CFLAGS) -L.
LIBOBJS = http_lib.o
TARGETS = libhttp.a http
all: $(TARGETS)
http: http.o libhttp.a
$(CC) $(LDFLAGS) $@.o -lhttp $(SYSLIBS) -o $@
libhttp.a: $(LIBOBJS)
$(RM) $@
$(AR) r $@ $(LIBOBJS)
$(RANLIB) $@
install: $(TARGETS)
$(CP) http $(BINDIR)
$(CP) libhttp.a $(LIBDIR)
$(CP) man1/http.1 $(MANDIR)/man1
$(CP) man3/http_lib.3 $(MANDIR)/man3
$(CP) http_lib.h $(INCDIR)
clean:
$(RM) $(TARGETS)
$(RM) *.tgz
$(RM) *.o
$(RM) *~
$(RM) #*
$(RM) core
depend:
makedepend $(INCLPATH) $(DEFINES) *.c
# internal use
man3: http_lib.c
$(MKDIR) $@
( cd $@ ; c2man -i \"http_lib.h\" -ngv -ls ../http_lib.c )
fdoc:
$(RM) -r man3
$(MAKE) man3
pure:
$(MAKE) clean
$(MAKE) CC="purify gcc -g"
tar:
$(MAKE) clean
$(RM) -r http-tiny-$(VERSION)
$(RM) -f http-tiny-*.tar.gz
$(MKDIR) http-tiny-$(VERSION)
-$(CP) * http-tiny-$(VERSION)
$(TAR) cf - man1 | (cd http-tiny-$(VERSION) ; $(TAR) xvf - )
$(TAR) cf - man3 | (cd http-tiny-$(VERSION) ; $(TAR) xvf - )
$(TAR) cvfz http-tiny-$(VERSION).tar.gz http-tiny-$(VERSION)
#distrib: tar
# $(CP) http-tiny-$(VERSION).tar.gz /poubelle/ftp/www/
# $(CP) http-tiny-$(VERSION).tar.gz /users/dl/public_html/
# DO NOT DELETE THIS LINE -- make depend depends on it.