diff Makefile @ 34:5d51fff843eb default tip

A "commit dump" of random changes I've made, as I probably won't be touching this code anymore.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 08 Mar 2020 19:18:48 +0200
parents a6e6f87414ea
children
line wrap: on
line diff
--- a/Makefile	Sun Mar 08 19:14:25 2020 +0200
+++ b/Makefile	Sun Mar 08 19:18:48 2020 +0200
@@ -59,7 +59,7 @@
 LIBTIFF_CFLAGS:=$(shell pkg-config --cflags libtiff-4)
 LIBTIFF_LDFLAGS:=$(shell pkg-config --libs libtiff-4)
 
-CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer
+CFLAGS:=-O3 -W -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer
 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT
 CFLAGS+=-I. $(LIBSDL_CFLAGS) $(LIBPNG_CFLAGS) $(LIBJPEG_CFLAGS) $(LIBTIFF_CFLAGS) $(LIBEXIF_CFLAGS)
 CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\"
@@ -200,13 +200,13 @@
 endif # !CONFIG_APPLE 
 
 LIBS+=-lm -lpthread
-BPGDEC_LIBS:=$(LIBPNG_LDFLAGS) $(LIBS)
+BPGDEC_LIBS:=$(LIBPNG_LDFLAGS) $(LIBEXIF_LDFLAGS) $(LIBS)
 BPGENC_LIBS+=$(LIBPNG_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBTIFF_LDFLAGS) $(LIBEXIF_LDFLAGS) $(LIBS)
 BPGVIEW_LIBS:=$(LIBSDL_LDFLAGS) $(LIBS)
 
 endif #!CONFIG_WIN32
 
-bpgenc.o: CFLAGS+=-Wno-unused-but-set-variable
+bpgenc.o:
 
 libbpg.a: $(LIBBPG_OBJS) 
 	$(AR) rcs $@ $^
@@ -260,6 +260,22 @@
 %.js8a.o: %.c
 	$(EMCC) $(EMCFLAGS) -c -o $@ $<
 
+
+BPGENC_OPTS=-keepmetadata -q 24
+# -c rgb
+
+%.bpg: %.tif bpgenc
+	./bpgenc $(BPGENC_OPTS) $< -o $@
+
+%.bpg: %.jpg bpgenc
+	./bpgenc $(BPGENC_OPTS) $< -o $@
+
+%.bpg: %.JPG bpgenc
+	./bpgenc $(BPGENC_OPTS) $< -o $@
+
+test: $(patsubst %.tif,%.bpg,$(wildcard *.tif)) $(patsubst %.jpg,%.bpg,$(wildcard *.jpg)) $(patsubst %.JPG,%.bpg,$(wildcard *.JPG))
+
+
 -include $(wildcard *.d)
 -include $(wildcard libavcodec/*.d)
 -include $(wildcard libavutil/*.d)