aboutsummaryrefslogtreecommitdiffstats
path: root/www/cgihtml/files/Makefile
blob: 10ce3c33e774b9c334d39e053aa3152e11899660 (plain) (blame)
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
# $FreeBSD$
# Makefile for cgihtml libraries

LIB = cgihtml
MAJ = 1
SHLIB_VER = $(MAJ)

OBJS = string-lib.o cgi-llist.o cgi-lib.o html-lib.o
HDRS =  ${OBJS:.o=.h}
SRCS =  ${OBJS:.o=.c}
SOBJS = ${OBJS:.o=.so}

.SUFFIXES:
.SUFFIXES: .o .so .c

.c.o:
    ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
    @${LD} -O ${.TARGET} -x -r ${.TARGET}

.c.so:
    ${CC} -fpic -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
    @${LD} -O ${.TARGET} -x -r ${.TARGET}

lib${LIB}.a: ${OBJS}
    @${ECHO} building standard ${LIB} library
    @rm -f ${.TARGET}
    @${AR} cr ${.TARGET} `lorder ${OBJS} | tsort -q`
    ${RANLIB} ${.TARGET}

lib${LIB}.so.${SHLIB_VER}: ${SOBJS}
    @${ECHO} building shared ${LIB} library \(version ${SHLIB_VER}\)
    @rm -f ${.TARGET}
    ${CC} -shared -Wl,-x -o ${.TARGET} `lorder ${SOBJS} | tsort -q`

all: depend lib${LIB}.a lib${LIB}.so.${SHLIB_VER}

install:
    @mkdir -p ${PREFIX}/lib
    @mkdir -p ${PREFIX}/include
    ${INSTALL} -c -m 644 lib${LIB}.a ${PREFIX}/lib
#   ${RANLIB} -t ${PREFIX}/lib/lib${LIB}.a
    ${INSTALL} -c -m 644 lib${LIB}.so.${SHLIB_VER} ${PREFIX}/lib
    @ln -s ${PREFIX}/lib/lib${LIB}.so.${SHLIB_VER} ${PREFIX}/lib/lib${LIB}.so
.for file in ${HDRS}
    ${INSTALL} -c -m 644 ${file} ${PREFIX}/include
.endfor

clean:
    rm -f *.o *.so lib${LIB}.a lib${LIB}.so.${SHLIB_VER}

distclean: clean
    rm -f .depend

depend:
    mkdep ${CFLAGS} ${SRCS}