"checkit_tiff" is an incredibly fast conformance checker for baseline TIFFs (with various extensions), see http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.6 KiB

# rule based checks if given TIFF is a specific baseline TIFF
# author: Andreas Romeyke, 2015
# licensed under conditions of libtiff
# (see http://libtiff.maptools.org/misc.html)
### needs libtiff (>= v4)
### libpcre (>=v3)
LIB+=-lpcre -ltiff -lm
SANITIZE?=-fsanitize=undefined -fsanitize=shift \
-fsanitize=integer-divide-by-zero -fsanitize=unreachable \
-fsanitize=vla-bound -fsanitize=null -fsanitize=return \
SRCS=$(wildcard tagrules/*.c) check_helper.c check_ifd.c config_parser.c
OBJS=$(patsubst %.c,%.o, $(SRCS))
# default target
all: checkit_tiff test
# remove debugging symbols (smaller size)
strip: all
strip --strip-all checkit_tiff
config_parser.c: config_dsl.grammar.c
config_dsl.grammar.c: config_dsl.grammar.peg
%.o: %.c
$(CC) $(CFLAGS) $(INC) -c $< -o $@
# produce parser via PEG
%.c: %.peg
peg $< > $@
-include version.mk
checkit_tiff.o: checkit_tiff.c
$(CC) -DVERSION="\"0.$(REPO_REVISION)\"" $(CFLAGS) $(INC) -c $< -o $@
# default executable
checkit_tiff: $(OBJS) checkit_tiff.o
$(CC) -o $@ $(CFLAGS) $(INC) $^ $(LIB)
test: $(OBJS) test.o
$(CC) -o $@ $(CFLAGS) $(INC) $^ $(LIB)
test.c: $(GRAMMAR)
# doc
doc: ../common/doxygen.conf
@doxygen ../common/doxygen.conf
# clean workdir
@rm -f *.o tagrules/*.o
@rm -f checkit_tiff test
# mrproper clean
distclean: clean
@rm -f *~ tagrules/*~
@rm -f core
@rm -Rf doc/
@rm -f .depend
@rm -f *.d
@rm -f .depend
depend: .depend
.depend: $(SRCS)
rm -f ./.depend
$(CC) $(CFLAGS) -MM $^>>./.depend;
-include .depend
.PHONY: all clean distclean strip depend