Files
ssocr/Makefile
T
Erik Auerswald 08a628ff04 how to work around some compilation failures
C compilers are getting more aggressive with warnings and are producing
more false positives.  While I intend to keep ssocr compiling without
warnings (as in the last 15 years), I do not use the newest C compilers,
but rather the GCC version included in a stable GNU/Linux distribution,
it may take some time for me to encounter those problems myself, and thus
it may take some time for me to work around them.

A user reported a compilation failure due to new warnings in GCC 10.1.
Since I currently use GCC 7.5.0 from Ubuntu 18.04 LTS, I do not see
those warnings yet, and thus cannot test any workarounds yet.

A first investigation into the issue hints at a need to replace valid code
with code invalid for GCC's default C standard version (necessitating
the specification of a newer C standard in the CFLAGS) to work around
said problem.  I have no idea if there are additional warnings with GCC
10.1 after working around that one.  Since Google blocks my emails to
the reporting user, I cannot even communicate to find this out.  Thus any
code changes will have to wait for either a GCC version with additional
warnings arriving in my GNU/Linux distribution, or establishment of a
different communication channel, e.g., a GitHub issue.
2020-08-03 23:12:08 +02:00

61 lines
2.2 KiB
Makefile

# minimal CFLAGS definition (try if compilation fails with default CFLAGS)
#CFLAGS := $(shell imlib2-config --cflags)
# default CFLAGS definition
CFLAGS := -D_FORTIFY_SOURCE=2 -Wall -W -Wextra -pedantic -Werror -pedantic-errors -fstack-protector-all $(shell imlib2-config --cflags) -O3
LDLIBS := -lm $(shell imlib2-config --libs)
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
MANDIR := $(PREFIX)/share/man/man1
DOCDIR := $(PREFIX)/share/doc/ssocr
DOCS := AUTHORS COPYING INSTALL README THANKS
VERSION := $(shell sed -n 's/^.*VERSION.*\(".*"\).*/\1/p' defines.h)
all: ssocr ssocr.1
ssocr: ssocr.o imgproc.o help.o charset.o
ssocr.o: ssocr.c ssocr.h defines.h imgproc.h help.h charset.h Makefile
imgproc.o: imgproc.c defines.h imgproc.h help.h Makefile
help.o: help.c defines.h imgproc.h help.h Makefile
charset.o: charset.c charset.h defines.h help.h Makefile
ssocr.1: ssocr.1.in Makefile
sed -e "s/@VERSION@/$(VERSION)/" \
-e "s/@DATE@/$(shell date +%Y-%m-%d)/" <$< >$@
ssocr-manpage.html: ssocr.1
rman -f html -r '' $< >$@
install: all
install -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR) $(DESTDIR)$(DOCDIR)
install -s -m 0755 ssocr $(DESTDIR)$(BINDIR)/ssocr
install -m 0644 ssocr.1 $(DESTDIR)$(MANDIR)/ssocr.1
gzip -9 $(DESTDIR)$(MANDIR)/ssocr.1
install -m 0644 $(DOCS) $(DESTDIR)$(DOCDIR)
ssocr-dir:
install -d ssocr-$(VERSION)
install -m 0644 Makefile $(DOCS) *.[ch] *.in ssocr-$(VERSION)
install -d ssocr-$(VERSION)/notdebian
install -m 0644 notdebian/* ssocr-$(VERSION)/notdebian
chmod +x ssocr-$(VERSION)/notdebian/rules
notdebian/changelog:
printf "ssocr ($(VERSION)-1) unstable; urgency=low\n\n * self built package of current ssocr version in .deb format\n\n -- $(USER) $(shell date -R)\n" >$@
selfdeb: notdebian/changelog notdebian/control notdebian/rules ssocr-dir
(cd ssocr-$(VERSION); ln -sv notdebian debian; fakeroot debian/rules binary; fakeroot debian/rules clean; rm -f debian)
tar: ssocr-dir
tar cvfj ssocr-$(VERSION).tar.bz2 ssocr-$(VERSION)
clean:
$(RM) ssocr ssocr.1 *.o *~ testbild.png ssocr-manpage.html
$(RM) notdebian/changelog
$(RM) -r ssocr-$(VERSION) ssocr-?.?.? ssocr-?.??.?
distclean: clean
$(RM) *.deb *.bz2
.PHONY: clean tar ssocr-dir install