summaryrefslogtreecommitdiff
path: root/support/word2x/Makefile.linux
blob: 471743bcd22f8fcb171ee2886413abdf7118bc27 (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
# $Id: Makefile,v 1.12 1997/04/09 04:57:12 dps Exp $
#
#Makefile for word2x
#Test system is Linux 2.1.30, gcc 2.7.2, libc 5.4.27

#if you are compiling on SUNOS, use the following
#CPPFLAGS=-g -Wall -DSUNOS=1
#LD=./sunos_link

#For normal systems try this instead
CPPFLAGS=-g -Wall
LD=ld

CCFLAGS=-O3
LIBOBJS=wordwrap.o nullproc.o tblock.o scan_num.o map_chars.o col-align.o \
	ukdate.o usdate.o
AR=ar
RANLIB=ranlib
MYLIBS=liboutfmt.a
READER=reader.o
FMTS=fmt-text.o fmt-latex.o
CPP=g++
#Set to gopt.o if you lack getopt_long
GETOPT=
PROGOBJS=$(READER) word2x.o $(FMTS) $(GETOPT) $(MYLIBS) 
TARGETS=word2x rtest2

all:	$(TARGETS)

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

clobber: clean
	rm -f $(TARGETS)

word2x.tar.gz:
	tar -C .. -czf word2x.tar.gz word2x \
	    --exclude word2x/RCS --exclude word2x/word2x.tar.gz


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

rtest2:	rtest2.o reader.o tblock.o
	g++ -o rtest2 rtest2.o reader.o 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

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)

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