$OpenBSD: patch-libjbig_Makefile,v 1.5 2006/10/19 13:53:48 naddy Exp $ --- libjbig/Makefile.orig Tue Jun 8 10:40:06 2004 +++ libjbig/Makefile Mon Dec 26 12:53:54 2005 @@ -7,17 +7,32 @@ CC = gcc # Options for the compiler: A high optimization level is suggested CFLAGS = -O -Wall -ansi -pedantic -all: libjbig.a tstcodec +PICFLAG= -fpic +.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes" +all: libjbig.a +.else +all: libjbig.a libjbig.so.$(VERSION) +.endif + tstcodec: tstcodec.c jbig.c jbig.h jbig_tab.o $(CC) $(CFLAGS) -o tstcodec -DTEST_CODEC tstcodec.c jbig.c \ jbig_tab.o libjbig.a: jbig.o jbig_tab.o - rm -f libjbig.a - ar rc libjbig.a jbig.o jbig_tab.o - -ranlib libjbig.a + rm -f ${.TARGET} + ar rc ${.TARGET} ${.ALLSRC} + ranlib ${.TARGET} +libjbig.so.$(VERSION): jbig.so jbig_tab.so + rm -f ${.TARGET} + ${CC} -shared $(PICFLAG) -o ${.TARGET} ${.ALLSRC} + +.SUFFIXES: .o .so + +.c.so: + ${CC} ${CFLAGS} $(PICFLAG) -c ${.IMPSRC} -o ${.TARGET} + jbig.o: jbig.c jbig.h test: tstcodec @@ -27,4 +42,4 @@ t82test.pbm: tstcodec ./tstcodec $@ clean: - rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec t82test.pbm + rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec libjbig.so.$(VERSION) libjbig.a