File: makefile

package info (click to toggle)
wp2latex 3.112%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,916 kB
  • sloc: cpp: 49,708; ansic: 9,318; asm: 5,429; makefile: 542; sh: 22
file content (133 lines) | stat: -rw-r--r-- 2,625 bytes parent folder | download
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# makefile for wp2latex for EMX (gcc)
# runs under DOS, linux, solaris and perhaps OS/2
#
GCC=gcc
FLAGS=-Wall -O2 -I../atoms/include/ -DERROR_HANDLER
OBJ=.o


#### OS autodetection part of makefile ####

ifeq ($(GETTEXT),-D__gettext__)
ifeq ($(OSTYPE),)		#-lintl is no longer needed under linux
LIBS=-lintl
endif 
IGETTEXTOBJ=igettext$(OBJ)
endif

# for Linux - debian
ifeq ($(OSTYPE),linux-gnu)
GCC = g++
endif

# for Linux - Slackware
ifeq ($(OSTYPE),linux)
LIBS+= -lstdc++
endif

# for Linux - Red Hat
ifeq ($(OSTYPE),Linux)
LIBS+= -lstdc++
endif
#end of Linux

# for sun
ifeq ($(OSTYPE),solaris)
LIBS=-lm
endif

ifeq ($(OSTYPE),sunos4)
LIBS=-lm -lstdc++
endif
#end of sun

#for OS/2
ifneq "$(OS2_SHELL)" ""
TARGET_NAME = cpbldr.exe
OSTYPE = os2
LIBS=-s -lstdcpp
endif

#Nothing is an indentifier for DOS? Too bad.
ifeq ($(OSTYPE),)
ifeq ($(HOSTTYPE),iris4d)
OSTYPE = iris4d
LIBS=-lm
else
TARGET_NAME = cpbldr.exe
OSTYPE = dos
endif
endif

# for aix
ifeq ($(OSTYPE),aix)
LIBS=-lm
endif
#end of aix


# Uncomment next line for compile a debugging version of WP2LaTeX
#DEBUG=-DDEBUG -g

CODEPAGES=wp4a.enc wp5.enc wp5_cz.enc wp6.enc 
CODEPAGES+=unicode.enc kam.enc koi8cs.enc
CODEPAGES+=is8859_1.enc is8859_2.enc is8859_3.enc is8859_4.enc
CODEPAGES+=cp852.enc cp1250.enc cp1251.enc cp1252.enc cp1253.enc cp1254.enc cp1255.enc
CODEPAGES+=mac_roma.enc

OUTPUTS=charactr.cc_ out_dir/macroman.trn out_dir/mtef.trn out_dir/html.trn out_dir/trn.trn out_dir/cpg.trn


SOURCES=cpbldr$(OBJ) cplib$(OBJ)


######### End of definitions starting compile rules ###########

.SUFFIXES: .cc $(OBJ) .exe .enc
.PHONY: all default distclean generic clean


default: out_dir/trn.trn
#

out_dir:
	mkdir -p $@

.cc$(OBJ):  *.h $(MAKEFILE_LIST)
	$(GCC) $(FLAGS) $(DEBUG) -c $*.cc $(ERROR) -o $*$(OBJ) $(GETTEXT)

$(OBJ).exe: $(MAKEFILE_LIST)
	$(GCC) $(FLAGS) $*$(OBJ) $(LIBS) $(ERROR)

cpbldr: $(SOURCES) ../atoms/libatoms.a $(MAKEFILE_LIST)
	$(GCC) -o cpbldr $(SOURCES) ../atoms/libatoms.a

$(OUTPUTS): cpbldr $(CODEPAGES) chars.c_ | out_dir
	./cpbldr -dir out_dir



all:	$(OUTPUTS)
#	$(TARGET_NAME) -i test/charactr.wp

clean:
	@echo Operating system is $(OSTYPE)
	rm -f *.exe *$(OBJ) *.o *.obj *.bak *.bkp core cplib cpbldr

distclean: clean
	rm -f *.trn
	rm -f internal.enc
	rm -f charactr.cc_
	rm -f out_dir/*.trn out_dir/*.enc
	#cp makefile.gen makefile

generic:
	rm makefile
	cp makefile.gen makefile

../atoms/libatoms.a: ../atoms/*.cc
	make -C ../atoms libatoms.a


cpbldr$(OBJ): cpbldr.cc cplib.cc *.h