Blob Blame History Raw
# Unix makefile for the JBIG-KIT library

# Select an ANSI/ISO C compiler here, GNU gcc is recommended
CC = gcc

# Options for the compiler: A high optimization level is suggested
CFLAGS = $(RPM_OPT_FLAGS) -W -Wall -ansi -pedantic # --coverage
PICFLAGS := -fPIC -DPIC

all: libjbig.so.$(VERSION) tstcodec tstcodec85

tstcodec: tstcodec.o libjbig.so
	$(CC) $(CFLAGS) -o tstcodec $< -L. -ljbig

tstcodec85: tstcodec85.o libjbig85.so
	$(CC) $(CFLAGS) -o tstcodec85 $^ -L. -ljbig

%.so: %.so.$(VERSION)
	ln -sf $< $@

libjbig.so.$(VERSION): jbig.o jbig_ar.o
	$(CC) $(CFLAGS) -shared -Wl,-soname,$@ -o $@ $^

libjbig85.so.$(VERSION): jbig85.o jbig_ar.o
	$(CC) $(CFLAGS) -shared -Wl,-soname,$@ -o $@ $^

jbig.o jbig85.o jbig_ar.o: CFLAGS += $(PICFLAGS)

jbig.o: jbig.c jbig.h jbig_ar.h
jbig85.o: jbig85.c jbig85.h jbig_ar.h
jbig_ar.o: jbig_ar.c jbig_ar.h
tstcodec.o: tstcodec.c jbig.h
tstcodec85.o: tstcodec85.c jbig85.h

update-po: jbig.c jbig85.c Makefile
	xgettext -ojbig.pot -k_ \
	  --copyright-holder='Markus Kuhn' \
	  --msgid-bugs-address='http://www.cl.cam.ac.uk/~mgk25/jbigkit/' \
	  --package-name jbigkit \
	jbig.c jbig85.c
	cd po && for po in *.po ; do \
	  msgmerge --update $$po ../jbig.pot ; done

analyze:
	clang --analyze *.c

test: tstcodec tstcodec85
	LD_LIBRARY_PATH=`pwd` ./tstcodec
	LD_LIBRARY_PATH=`pwd` ./tstcodec85

t82test.pbm: tstcodec
	LD_LIBRARY_PATH=`pwd` ./tstcodec $@

clean:
	rm -f *.o *.gcda *.gcno *.gcov *.plist *~ core gmon.out dbg_d\=??.pbm
	rm -f t82test.pbm
	rm -f tstcodec tstcodec85