summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex-src/Makefile
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-06-26 02:37:10 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-06-26 02:37:10 +0000
commitd20548087f4b3f821726e5ea2ae506b134fcbdfe (patch)
tree27be02e71d8e0d3f43ae3a24054c6b4f751a95ec /Build/source/texk/detex/detex-src/Makefile
parent9f9d4524eb411625a4fe3a0d6a0162a798be6cfb (diff)
opendetex-2.8.3
git-svn-id: svn://tug.org/texlive/trunk@48092 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/detex/detex-src/Makefile')
-rw-r--r--Build/source/texk/detex/detex-src/Makefile53
1 files changed, 37 insertions, 16 deletions
diff --git a/Build/source/texk/detex/detex-src/Makefile b/Build/source/texk/detex/detex-src/Makefile
index e6a75b763a7..5358b291040 100644
--- a/Build/source/texk/detex/detex-src/Makefile
+++ b/Build/source/texk/detex/detex-src/Makefile
@@ -38,6 +38,8 @@
#
# Detex is a program to remove TeX and LaTeX constructs from text source.
+UNAME_S := $(shell uname -s)
+
# Installation directory
#
DESTDIR = /usr/local/bin
@@ -69,25 +71,27 @@ DEFS =
#
#DEFS += ${DEFS} -DNO_MALLOC_DECL
#
-CFLAGS = -O ${DEFS}
+CFLAGS = -O ${DEFS} -Wall
# Use your favorite lexical scanner
#
-LEX = lex
-#LEX = flex
+#LEX = lex
+LEX = flex
#LFLAGS = -8 -C
# scanner library
#
-LEXLIB = -ll
-#LEXLIB = -lfl
+LEXLIB = -lfl
+ifeq ($(UNAME_S),Darwin)
+ LEXLIB = -ll
+endif
LPR = lpr -p
# Program names
#
-PROGS = detex
+PROGS = detex delatex
# Header files
#
@@ -101,39 +105,56 @@ SRC = detex.l
#
D_OBJ = detex.o
+VERSION = 2.8.3
+
all: ${PROGS}
detex: ${D_OBJ}
${CC} ${CFLAGS} -o $@ ${D_OBJ} ${LEXLIB}
-detex.c:
- sed -f states.sed detex.l > xxx.l
- ${LEX} ${LFLAGS} xxx.l
- rm -f xxx.l
- mv lex.yy.c detex.c
+delatex: detex
+ cp detex delatex
-lexout.c: detex.c
- mv detex.c lexout.c
+detex.c: detex.l
+ ${LEX} ${LFLAGS} detex.l
+ mv lex.yy.c detex.c
man-page:
troff -man detex.1l
# If you want detex available as delatex, uncomment the last two lines of
# this target
-install: detex
+install: all
rm -f ${DESTDIR}/detex
- install -c -m 775 -o binary -g staff -s detex ${DESTDIR}
+ install -c -m 775 -g staff -s detex ${DESTDIR}
+ install detex.1l /usr/local/share/man/man1
# rm -f ${DESTDIR}/delatex
# ln ${DESTDIR}/detex ${DESTDIR}/delatex
+uninstall:
+ rm -f ${DESTDIR}/detex
+ rm -f ${DESTDIR}/delatex
+ rm -f /usr/local/share/man/man1/detex.*
+
clean:
-rm -f a.out core *.s *.o ERRS errs .,* .emacs_[0-9]*
- -rm -f ${PROGS} xxx.l lex.yy.c
+ -rm -f ${PROGS} xxx.l lex.yy.c detex.c
+ -rm -f *.tar.bz2
print: ${HDR} ${SRC}
${LPR} Makefile ${HDR} ${SRC}
+test: all
+ ./test.pl
+
+run: delatex
+ ./delatex in > out.txt
+
+package: clean detex.c
+ tar cjfv opendetex-${VERSION}.tar.bz2 ChangeLog COPYRIGHT detex.* INSTALL Makefile README
+
# Dependencies
#
detex.c: detex.h
detex.c: detex.l
+