summaryrefslogtreecommitdiff
path: root/support/word2x/Makefile.in
blob: 935da6688ef0323976a6cd28598b0dc1c7f28963 (plain)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# $Id: Makefile.in,v 1.18 1997/04/13 09:11:40 dps Exp dps $
#
# My test system is Linux 2.1.30, gcc 2.7.2, libc 5.4.27

CC=@CC@
CPP=@CXX@

#seek_set_hdr is a hack for Sun OS (and others? I hope not)
CPPFLAGS=-g -Wall @DEFS@ @seek_set_hdr@
LD=@ld@

CCFLAGS=-O3 @DEFS@
LIBOBJS=wordwrap.o nullproc.o tblock.o scan_num.o map_chars.o col-align.o \
	compat.o num_unit_probe.o part_num_probe.o
AR=ar
RANLIB=@RANLIB@
MYLIBS=liboutfmt.a
READER=reader.o strip.o
FMTS=fmt-text.o fmt-latex.o fmt-html.o
DATEFMTS=dedate.o deL1date.o deHTMLdate.o ukdate.o usdate.o
#Set to gopt.o if you lack getopt_long
GETOPT=@getopt@
ALLOCA=@ALLOCA@
PROGOBJS=$(READER) word2x.o $(FMTS) $(DATEFMTS) $(GETOPT) $(ALLOCA) $(MYLIBS) 
TARGETS=word2x rtest2
MANP=word2x.1
prefix=@prefix@
exec_prefix=@exec_prefix@

%.o: %.cc
	$(CPP) $(CPPFLAGS) -c -o $@ $<

%.o: $.c $(CC) $(CCFLAGS) -c -o $@ $<

all:	config.h $(TARGETS)

config.h:	configure.in Makefile.in config.h.in
	./configure

configure: configure.in
	autoconf

Makefile: Makefile.in configure
	./configure

clean:
	rm -f *.o
	rm -f $(MYLIBS)

clobber: clean
	rm -f $(TARGETS)
	rm -f config.h Makefile
	rm -f config.cache config.status config.log *~
	rm -f cfg-script make-script

word2x.tar.gz: clobber configure config.h.in configure.in Makefile.in transcript
	chmod a-w configure
	tar -C .. -czf word2x.tar.gz word2x \
	    --exclude word2x/RCS --exclude word2x/word2x.tar.gz \
	    --exclude word2x/samples --exclude word2x/config.cache \
	    --exclude word2x/config.status --exclude word2x/config.log \
	    --exclude word2x/catdoc.c --exclude word2x/catdoc.msg \
	    --exclude word2x/config.h --exclude word2x/Makefile \
	    --exclude word2x/config.cache --exclude word2x/config.status \
	    --exclude word2x/config.log
	chmod 755 configure

transcript:  cfg-script make-script
	@echo "word2x build transcript" >transcript
	@echo "Note: the prompts are simulated. All the rest is real." >>transcript
	@echo "Simulation> ./configure" >>transcript
	@cat cfg-script >>transcript
	@echo "Simulation> make all" >>transcript
	@cat make-script >>transcript
	rm -f cfg-script make-script

cfg-script:
	@rm -f config.cache config.h
	./configure 2>&1 | tee cfg-script

make-script: config.h
	make all 2>&1 | tee make-script

liboutfmt.a: $(LIBOBJS)
	$(AR) rc $@ $(LIBOBJS)
	$(RANLIB) $@

rtest2:	rtest2.o $(READER) tblock.o
	g++ -o rtest2 rtest2.o $(READER) tblock.o

fmt-text.o: text-fmt.o text-table.o
	$(LD) -r -o $@ text-fmt.o text-table.o

fmt-latex.o: latex-fmt.o latex-table.o latex-embed.o
	$(LD) -r -o $@ latex-fmt.o latex-table.o latex-embed.o

fmt-html.o: html-fmt.o html-table.o html-embed.o
	$(LD) -r -o $@ html-fmt.o html-table.o html-embed.o

getopt.o: getopt.c
	$(CC) $(CFLAGS) -D_LIBC=1 -c -o $@ $<

getopt1.o: getopt1.c
	$(CC) $(CFLAGS) -D_LIBC=1 -c -o $@ $<

gopt.o: getopt.o getopt1.o
	$(LD) -r -o gopt.o getopt.o getopt1.o

word2x: $(PROGOBJS)
	$(CPP) -o $@ $(PROGOBJS)

install: $(TARGETS) $(MANP)
	@INSTALL@ $(MANP) -m 644 @mandir@/man1
	for I in $(TARGETS); do \
		@INSTALL@ $${I} -m 755 @bindir@; \
	done