about summary refs log tree commit diff
path: root/converter/pbm/Makefile
blob: 0461eedc68ff8e9ba2d32ed0195886a51af205d3 (plain) (blame)
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
ifeq ($(SRCDIR)x,x)
  SRCDIR = $(CURDIR)/../..
  BUILDDIR = $(SRCDIR)
endif
SUBDIR = converter/pbm
VPATH=.:$(SRCDIR)/$(SUBDIR)

include $(BUILDDIR)/config.mk

PORTBINARIES =	atktopbm brushtopbm cistopbm cmuwmtopbm \
		ddbugtopbm g3topbm escp2topbm \
		icontopbm macptopbm mdatopbm mgrtopbm mrftopbm \
		pbmto10x pbmto4425 pbmtoascii pbmtoatk \
		pbmtobbnbg pbmtocis pbmtocmuwm pbmtodjvurle \
		pbmtoepsi pbmtoepson pbmtoescp2 \
		pbmtog3 pbmtogem pbmtogo pbmtoibm23xx pbmtoicon pbmtolj \
		pbmtoln03 pbmtolps \
		pbmtomacp pbmtomatrixorbital pbmtomda pbmtomgr pbmtomrf \
		pbmtonokia \
		pbmtopi3 pbmtoplot pbmtopsg3 pbmtoptx pbmtowbmp \
		pbmtoxbm pbmtoybm pbmtozinc \
		pi3topbm pktopbm \
		wbmptopbm xbmtopbm ybmtopbm	

ifneq ($(LEX)x,x)
  PORTBINARIES += thinkjettopbm
endif

#pbmpage uses sqrt(), which is sometimes in libc, not libm.  Is it ever
#in libm?
MATHBINARIES =	pbmtopk
BINARIES =	$(PORTBINARIES) $(MATHBINARIES)
SCRIPTS =       pbmtox10bm

OBJECTS = $(BINARIES:%=%.o)

MERGEBINARIES = $(BINARIES)
MERGE_OBJECTS = $(MERGEBINARIES:%=%.o2)

SUBDIRS=pbmtoppa

.PHONY: all
all: $(BINARIES) $(SUBDIRS:%=%/all)

include $(SRCDIR)/common.mk

ifneq ($(LEX)x,x)
thinkjettopbm.c1:%.c1:%.l
	$(LEX) -t $< >$@
endif

thinkjettopbm.c:%.c:%.c1 $(SRCDIR)/lib/util/lexheader
# Different versions of Lex produce subtly different output, from the
# same .l source file.  The .c1 file contains the raw output from Lex.
# We now massage it so it will compile.  We must add some definitions
# at the top (the lexheader file).  We must remove any yylex and
# yywrap prototype, as our .l file already contains one.  The Lex
# version "Software Generation Utilities (SGU) Solaris-ELF (4.0)"
# puts declarations for yylex and yywrap, as external symbols,
# into its output, causing a duplicate declaration error at compile time.
#
# Schwarb Manfred reports that it compiles OK, but with warnings, on
# Solaris.  Solaris Lex has a -e option that eliminates the lex
# warnings, but causes compiler warnings.  AIX and Flex don't have a
# -e option.  -Bryan 2001.05.16.
#
# But Peter Weisz reported on 2002.12.11 that on Solaris, compile
# failed due to a duplicate declaration of yylex and yywrap with Netpbm
# 10.12, which does not remove those declarations as the current version
# does.
	cat $(SRCDIR)/lib/util/lexheader $< | \
	  grep -v "^[[:space:]]*int yylex(void);" | \
	  grep -v "^[[:space:]]*int yywrap(void);" \
	  >$@

thisdirclean: localclean
.PHONY: localclean
localclean:
	-rm -f thinkjettopbm.c