ARCH=@ARCH@ SO=ImageLib-$(ARCH).so ARCHIVE=$(SO:.so=.a) SYSDIR=../../system SLIB=$(SYSDIR)/$(SO) DIRS=CxImage raw jbig SLIBS=CxImage/cximage.a raw/raw.a jbig/jbig.a ifeq ($(findstring osx,$(ARCH)), osx) export ARCH DIRS+=jasper SLIBS+=jasper/jasper.a endif .PHONY: compile $(SLIB): $(SLIBS) ifeq ($(findstring osx,$(ARCH)), osx) $(CXX) $(LDFLAGS) -bundle -undefined dynamic_lookup -lpng -ljpeg -ltiff -lz -o $@ \ CxImage/*.o jasper/*/*.o jbig/*.o raw/*.o else $(CXX) $(CFLAGS) $(LDFLAGS) -shared -o $(SLIB) -Wl,--whole-archive $(SLIBS) \ -Wl,--no-whole-archive -lpng -ljasper -ljpeg -ltiff -lz -Wl,--unresolved-symbols=ignore-all endif $(SLIBS): compile CxImage/cximage.a: $(MAKE) -C CxImage ARCH=$(ARCH) jbig/jbig.a: $(MAKE) -C jbig raw/raw.a: $(MAKE) -C raw zlib/libz.a: $(MAKE) -C zlib jasper/jasper.a: $(MAKE) -C jasper jpeg/jpeg.a: $(MAKE) -C jpeg tiff/tiff.a: $(MAKE) -C tiff -include ../../Makefile.include