openbsd-ports/graphics/jbigkit/patches/patch-libjbig_Makefile
2004-02-25 20:31:00 +00:00

46 lines
1.2 KiB
Plaintext

$OpenBSD: patch-libjbig_Makefile,v 1.2 2004/02/25 20:31:01 brad Exp $
--- libjbig/Makefile.orig 2003-06-11 12:57:56.000000000 -0400
+++ libjbig/Makefile 2004-02-25 15:01:50.000000000 -0500
@@ -7,16 +7,31 @@ 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
@@ -24,4 +39,4 @@ test: tstcodec
./tstcodec
clean:
- rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec
+ rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec libjbig.so.$(VERSION) libjbig.a