1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
# This file is part of PODIFF.
# Copyright (C) 2011-2022 Sergey Poznyakoff
#
# PODIFF is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# PODIFF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this PODIFF. If not, see <http://www.gnu.org/licenses/>.
PACKAGE=podiff
VERSION=1.4
PREFIX=/usr
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
SOURCES=y.tab.c lex.yy.c main.c txtacc.c list.c
OBJECTS=$(SOURCES:.c=.o)
HEADERS=podiff.h
YACCSRC=podiff.y podiff.l
BUILT_FILES=lex.yy.c y.tab.c y.tab.h
MANFILES=podiff.1
EXTRA_DIST=COPYING README NEWS
CFLAGS=-ggdb
LIBS=
podiff: $(OBJECTS)
cc $(CFLAGS) $(LDFLAGS) -opodiff $(OBJECTS) $(LIBS)
y.tab.c y.tab.h: podiff.y
yacc -dt podiff.y
lex.yy.c: podiff.l
flex podiff.l
$(OBJECTS): podiff.h
y.tab.o lex.yy.o: podiff.h
.c.o:
cc -c $(CFLAGS) $(CPPFLAGS) -DVERSION=\"$(VERSION)\" $<
clean:
rm -f podiff *.o *~ $(PACKAGE)-$(VERSION)
allclean: clean
rm -f $(BUILT_FILES)
LSFILES=find . -type f | sort
distdir: $(BUILT_FILES)
test -d $(PACKAGE)-$(VERSION) && rm -r $(PACKAGE)-$(VERSION); \
mkdir $(PACKAGE)-$(VERSION); \
cp $(SOURCES) $(YACCSRC) $(HEADERS) \
$(BUILT_FILES) $(MANFILES) $(EXTRA_DIST) Makefile \
$(PACKAGE)-$(VERSION); \
cd $(PACKAGE)-$(VERSION); \
touch .before .after; \
$(LSFILES) > .before; \
make; \
make clean; \
$(LSFILES) > .after; \
files_left=`diff .before .after | sed -n 's/^> //p'`; \
if test -n "$$files_left"; then \
text="Files left after make clean:"; \
echo $$text | sed 's/./=/g' >&2; \
echo $$text >&2; \
echo $$text | sed 's/./-/g' >&2; \
echo $$files_left >&2; \
echo $$text | sed 's/./=/g' >&2; \
exit 1; \
else \
rm .before .after; \
fi
dist: distdir
tar cfhz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
rm -rf $(PACKAGE)-$(VERSION)
install-bin: podiff
cp podiff $(DESTDIR)$(BINDIR)
install-man: $(MANFILES)
for file in $(MANFILES); \
do \
sec=`expr "$$file" : '.*\.\([1-8]\)'`; \
cp $$file $(DESTDIR)$(MANDIR)/man$$sec; \
done
install: install-bin install-man
|