1998-06-14 12:38:56 +00:00
|
|
|
# Makefile for cgihtml libraries
|
|
|
|
|
|
|
|
LIB = cgihtml
|
1998-10-07 15:02:43 +00:00
|
|
|
MAJ = 1
|
|
|
|
MIN = 0
|
|
|
|
.if ($(PORTOBJFORMAT) == "elf")
|
|
|
|
SHLIB_VER = $(MAJ)
|
|
|
|
.else
|
|
|
|
SHLIB_VER = $(MAJ).$(MIN)
|
|
|
|
.endif
|
1998-06-14 12:38:56 +00:00
|
|
|
|
|
|
|
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
|
1998-10-07 15:02:43 +00:00
|
|
|
# ${RANLIB} -t ${PREFIX}/lib/lib${LIB}.a
|
1998-06-14 12:38:56 +00:00
|
|
|
${INSTALL} -c -m 644 lib${LIB}.so.${SHLIB_VER} ${PREFIX}/lib
|
1998-10-10 14:32:35 +00:00
|
|
|
@ln -s ${PREFIX}/lib/lib${LIB}.so.${SHLIB_VER} ${PREFIX}/lib/lib${LIB}.so
|
1998-06-14 12:38:56 +00:00
|
|
|
.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}
|
|
|
|
|