File: Makefile

package info (click to toggle)
src2tex 2.12h-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,136 kB
  • sloc: ansic: 5,679; sh: 405; makefile: 95; lisp: 46; sed: 39
file content (190 lines) | stat: -rw-r--r-- 5,346 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#{\hrulefill\ {\tt\#}
#	\vskip 1ex
#	\input fonts.tex % define fonts
#	\input title.tex % title and authors
#	\vskip 1ex
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}


#{\hrulefill\ Makefile\ \hrulefill\ {\tt\#}}


#{\hrulefill\ preliminaries\ \hrulefill\ {\tt\#}
# \par
# Here we just give preliminary definitions.
# If you don't have {\tt gcc}, please replace it with {\tt cc}
# and plug suitable values into {\tt CFLAGS}.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

CC	= gcc
#CFLAGS	= -O2
SRCS	= fileio.c getdata.c langflag.c modflag.c options.c pas_bold.c \
	tools.c text2tex.c src2tex.c
OBJS	= fileio.o getdata.o langflag.o modflag.o options.o pas_bold.o \
	tools.o text2tex.o src2tex.o

#{\hrulefill\ make all\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make all}'' gives you {\sl src2tex} and {\sl src2latex}.
# Hopefully, you do not encounter any errors.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

all :
	$(CC) $(CFLAGS) $(CPPFLAGS) -DUNIX -DTEX -c $(SRCS)
	$(CC) $(LDFLAGS) $(OBJS) -o src2tex
	$(CC) $(CFLAGS) $(CPPFLAGS) -DUNIX -DLATEX -c $(SRCS)
	$(CC) $(LDFLAGS) $(OBJS) -o src2latex

#{\hrulefill\ make install\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make install}'' just strips {\sl src2tex} and {\sl src2latex},
# and removes object files.
# You have to move executables to your favorite directory by yourself.
# No online manual is available at the moment.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

install :
	strip ./src2tex
	strip ./src2latex
	rm -f ./$(OBJS)
	@-echo ""
	@-echo " So, you have finished installation successively."
	@-echo " Please copy src2tex and src2latex to a suitable"
	@-echo " directory you like."
	@-echo ""

install.man :
	@-echo ""
	@-echo " Sorry, there exists no online manual."
	@-echo ""

#{\hrulefill\ make dos\ \hrulefill\ {\tt\#}
# \par
# If you are a DOS user,
# please just type ``{\tt make dos}''
# instead of ``{\tt make all}'' and ``{\tt make install}''.
# Then you will get {\sl src2tex.exe} and {\sl src2ltex.exe} .
# IF you don't have {\tt gcc},
# please replace it with {\tt cc} or something like that.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

dos :
	@-echo ""
	@-echo " Please don't be panic when  \"make dos\"  does not work."
	@-echo " What you have to do is to be patient and edit Makefile"
	@-echo " carefully.  I am sure it would turn out to be a piece"
	@-echo " of cake."
	@-echo ""
	$(CC) $(CFLAGS) -DDOS -DTEX -c $(SRCS)
	$(CC) $(OBJS) -o src2tex
	$(CC) $(CFLAGS) -DDOS -DLATEX -c $(SRCS)
	$(CC) $(OBJS) -o src2ltex
	del *.o

#{\hrulefill\ make verbose\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make verbose}'' generates noisy {\sl src2tex} and {\sl src2latex}.
# They report everything what they are doing.
# The authors are using them to find bugs.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

verbose :
	$(CC) -DDEBUGGING -DUNIX -DTEX -c $(SRCS)
	$(CC) $(OBJS) -o src2tex
	$(CC) -DDEBUGGING -DUNIX -DLATEX -c $(SRCS)
	$(CC) $(OBJS) -o src2latex

#{\hrulefill\ make plain\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make plain}'' generates plain {\sl src2tex} and {\sl src2latex}.
# They do not output any preambles and postambles;
# they simply output {\TeX}t without anything like
# \item{}
# $\backslash$documentstyle$\cdots$,
# \item{}
# $\backslash$begin{document},
# \item{}
# $\backslash$end{document},
# \item{}
# $\backslash$bye,
# \par
# \noindent They would be useful when you have to insert program lists
# into your manuscript written in {\TeX}.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

plain :
	$(CC) -DPLAIN -DUNIX -DTEX -c $(SRCS)
	$(CC) $(OBJS) -o src2tex
	$(CC) -DPLAIN -DUNIX -DLATEX -c $(SRCS)
	$(CC) $(OBJS) -o src2latex

clean :
	rm -f ./$(OBJS)
	rm -f ./a.out
	rm -f ./src2tex
	rm -f ./src2latex ./src2ltex
	rm -f ./*~
	rm -f ./*.bak
	rm -f ./Makefile.tex
	rm -f ./*.h.tex
	rm -f ./*.c.tex
	rm -f ./*.scm.tex
	rm -f ./*.red.tex
	rm -f ./contrib/src2tex2dvi.tex
	rm -f ./contrib/src2tex2ps.tex
	rm -f ./contrib/src2latex2dvi.tex
	rm -f ./contrib/src2latex2ps.tex
	rm -f ./contrib/c2tex.tex
	rm -f ./contrib/*~
	rm -f ./contrib/*.bak

#{\hrulefill\ make docs\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make docs}'' simply generates several examples
# by using {\sl src2tex2ps}, {\sl src2latex2ps}, {\it etc\/}.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

docs :
	src2tex2dvi Makefile
	src2tex2ps *.h
	src2tex2ps *.c
	src2latex2ps *.scm
	src2tex2ps popgen.red
	src2tex2ps -fourcolumns -pagelength 35 sqrt_mat.red
	cd ./contrib ; src2tex2dvi src2tex2dvi
	cd ./contrib ; src2tex2dvi src2tex2ps
	cd ./contrib ; src2tex2dvi src2latex2dvi
	cd ./contrib ; src2tex2dvi src2latex2ps
	cd ./contrib ; src2tex2dvi c2tex

#{\hrulefill\ make report\ \hrulefill\ {\tt\#}
# \par
# ``{\tt make report}'' send your local {\sl /etc/motd} file
# to one of the authors.
# This would be quite helpful for further development of {\sl src2tex}.
# \par
# \noindent{\tt\#}\ \hrulefill\ {\tt\#}}

report :
	@-if [ -f /etc/motd ] ; \
	then \
		echo "TITLE:src2tex version 2.12" > make_report.log; \
		echo USER:$(USER) >> make_report.log; \
		echo HOSTNAME:$(HOSTNAME) >> make_report.log; \
		cat /etc/motd >> make_report.log; \
		echo -n "reporting to kamano@po.iijnet.or.jp ... " ; \
		mail kamano@po.iijnet.or.jp \
			< make_report.log ; \
		echo "done" ; \
		rm make_report.log ; \
	else \
		echo "make report failed" ; \
		echo "thank you very much anyway" ; \
	fi