"Fossies" - the Fresh Open Source Software Archive

Member "pngquant-2.13.1/lib/Makefile" (22 Nov 2020, 4311 Bytes) of package /linux/misc/pngquant-2.13.1-src.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Makefile": 2.12.2_vs_2.12.3.

    1 -include config.mk
    2 
    3 STATICLIB=libimagequant.a
    4 SHAREDLIB=libimagequant.$(SOLIBSUFFIX)
    5 SOVER=0
    6 ifeq ($(SOLIBSUFFIX),dylib)
    7 	SHAREDLIBVER=libimagequant.$(SOVER).$(SOLIBSUFFIX)
    8 	FIX_INSTALL_NAME=install_name_tool -id $(LIBDIR)/$(SHAREDLIBVER) $(DESTDIR)$(LIBDIR)/$(SHAREDLIBVER)
    9 else
   10 	SHAREDLIBVER=libimagequant.$(SOLIBSUFFIX).$(SOVER)
   11 	FIX_INSTALL_NAME=
   12 endif
   13 
   14 JNILIB=libimagequant.jnilib
   15 DLL=imagequant.dll
   16 DLLIMP=imagequant_dll.a
   17 DLLDEF=imagequant_dll.def
   18 JNIDLL=libimagequant.dll
   19 JNIDLLIMP=libimagequant_dll.a
   20 JNIDLLDEF=libimagequant_dll.def
   21 
   22 OBJS = pam.o mediancut.o blur.o mempool.o kmeans.o nearest.o libimagequant.o
   23 SHAREDOBJS = $(subst .o,.lo,$(OBJS))
   24 
   25 JAVACLASSES = org/pngquant/LiqObject.class org/pngquant/PngQuant.class org/pngquant/Image.class org/pngquant/Result.class
   26 JAVAHEADERS = $(JAVACLASSES:.class=.h)
   27 JAVAINCLUDE = -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/linux' -I'$(JAVA_HOME)/include/win32' -I'$(JAVA_HOME)/include/darwin'
   28 
   29 DISTFILES = $(OBJS:.o=.c) *.h README.md CHANGELOG COPYRIGHT Makefile configure imagequant.pc.in
   30 TARNAME = libimagequant-$(VERSION)
   31 TARFILE = $(TARNAME)-src.tar.bz2
   32 PKGCONFIG = imagequant.pc
   33 
   34 all: static shared
   35 
   36 static: $(STATICLIB)
   37 
   38 shared: $(SHAREDLIB)
   39 
   40 dll:
   41 	$(MAKE) CFLAGS="$(CFLAGS) -DIMAGEQUANT_EXPORTS" $(DLL)
   42 
   43 java: $(JNILIB)
   44 
   45 java-dll:
   46 	$(MAKE) CFLAGS="$(CFLAGS) -DIMAGEQUANT_EXPORTS" $(JNIDLL)
   47 
   48 $(DLL) $(DLLIMP): $(OBJS)
   49 	$(CC) -fPIC -shared -o $(DLL) $^ $(LDFLAGS) -Wl,--out-implib,$(DLLIMP),--output-def,$(DLLDEF)
   50 
   51 $(STATICLIB): $(OBJS)
   52 	$(AR) $(ARFLAGS) $@ $^
   53 
   54 $(SHAREDOBJS):
   55 	$(CC) -fPIC $(CFLAGS) -c $(@:.lo=.c) -o $@
   56 
   57 libimagequant.so: $(SHAREDOBJS)
   58 	$(CC) -shared -Wl,-soname,$(SHAREDLIBVER) -o $(SHAREDLIBVER) $^ $(LDFLAGS)
   59 	ln -fs $(SHAREDLIBVER) $(SHAREDLIB)
   60 
   61 libimagequant.dylib: $(SHAREDOBJS)
   62 	$(CC) -shared -o $(SHAREDLIBVER) $^ $(LDFLAGS)
   63 	ln -fs $(SHAREDLIBVER) $(SHAREDLIB)
   64 
   65 $(OBJS): $(wildcard *.h) config.mk
   66 
   67 $(JNILIB): $(JAVAHEADERS) $(STATICLIB) org/pngquant/PngQuant.c
   68 	$(CC) -g $(CFLAGS) $(LDFLAGS) $(JAVAINCLUDE) -shared -o $@ org/pngquant/PngQuant.c $(STATICLIB)
   69 
   70 $(JNIDLL) $(JNIDLLIMP): $(JAVAHEADERS) $(OBJS) org/pngquant/PngQuant.c
   71 	$(CC) -fPIC -shared -I. $(JAVAINCLUDE) -o $(JNIDLL) $^ $(LDFLAGS) -Wl,--out-implib,$(JNIDLLIMP),--output-def,$(JNIDLLDEF)
   72 
   73 $(JAVACLASSES): %.class: %.java
   74 	javac $<
   75 
   76 $(JAVAHEADERS): %.h: %.class
   77 	javah -o $@ $(subst /,., $(patsubst %.class,%,$<)) && touch $@
   78 
   79 dist: $(TARFILE) cargo
   80 
   81 $(TARFILE): $(DISTFILES)
   82 	rm -rf $(TARFILE) $(TARNAME)
   83 	mkdir $(TARNAME)
   84 	cp $(DISTFILES) $(TARNAME)
   85 	tar -cjf $(TARFILE) --numeric-owner --exclude='._*' $(TARNAME)
   86 	rm -rf $(TARNAME)
   87 	-shasum $(TARFILE)
   88 
   89 cargo:
   90 	rm -rf msvc-dist
   91 	git clone . -b msvc msvc-dist
   92 	rm -rf msvc-dist/Cargo.toml msvc-dist/org msvc-dist/rust msvc-dist/README.md msvc-dist/COPYRIGHT
   93 	cargo test
   94 
   95 example: example.c lodepng.h lodepng.c $(STATICLIB)
   96 	$(CC) -g $(CFLAGS) -Wall example.c $(STATICLIB) -o example
   97 
   98 lodepng.h:
   99 	curl -o lodepng.h -L https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.h
  100 
  101 lodepng.c:
  102 	curl -o lodepng.c -L https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.cpp
  103 
  104 clean:
  105 	rm -f $(OBJS) $(SHAREDOBJS) $(SHAREDLIBVER) $(SHAREDLIB) $(STATICLIB) $(TARFILE) $(DLL) '$(DLLIMP)' '$(DLLDEF)'
  106 	rm -f $(JAVAHEADERS) $(JAVACLASSES) $(JNILIB) example
  107 
  108 distclean: clean
  109 	rm -f config.mk
  110 	rm -f imagequant.pc
  111 
  112 install: all $(PKGCONFIG)
  113 	install -d $(DESTDIR)$(LIBDIR)
  114 	install -d $(DESTDIR)$(PKGCONFIGDIR)
  115 	install -d $(DESTDIR)$(INCLUDEDIR)
  116 	install -m 644 $(STATICLIB) $(DESTDIR)$(LIBDIR)/$(STATICLIB)
  117 	install -m 644 $(SHAREDLIBVER) $(DESTDIR)$(LIBDIR)/$(SHAREDLIBVER)
  118 	ln -sf $(SHAREDLIBVER) $(DESTDIR)$(LIBDIR)/$(SHAREDLIB)
  119 	install -m 644 $(PKGCONFIG) $(DESTDIR)$(PKGCONFIGDIR)/$(PKGCONFIG)
  120 	install -m 644 libimagequant.h $(DESTDIR)$(INCLUDEDIR)/libimagequant.h
  121 	$(FIX_INSTALL_NAME)
  122 
  123 uninstall:
  124 	rm -f $(DESTDIR)$(LIBDIR)/$(STATICLIB)
  125 	rm -f $(DESTDIR)$(LIBDIR)/$(SHAREDLIBVER)
  126 	rm -f $(DESTDIR)$(LIBDIR)/$(SHAREDLIB)
  127 	rm -f $(DESTDIR)$(PKGCONFIGDIR)/$(PKGCONFIG)
  128 	rm -f $(DESTDIR)$(INCLUDEDIR)/libimagequant.h
  129 
  130 config.mk:
  131 ifeq ($(filter %clean %distclean, $(MAKECMDGOALS)), )
  132 	./configure
  133 endif
  134 
  135 $(PKGCONFIG): config.mk
  136 	sed 's|PREFIX|$(PREFIX)|;s|VERSION|$(VERSION)|' < imagequant.pc.in > $(PKGCONFIG)
  137 
  138 .PHONY: all static shared clean dist distclean dll java cargo
  139 .DELETE_ON_ERROR: