File: Makefile

package info (click to toggle)
sdc 1.0.8beta-8
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 1,400 kB
  • ctags: 874
  • sloc: lisp: 8,120; ansic: 967; makefile: 671; perl: 136; sh: 50
file content (267 lines) | stat: -rw-r--r-- 7,626 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#			    -*-makefile-*-
## Custumizable names:
# irz301:/ftpserv/ftp/pub/people/jerry
# First an excusion:
#  I din't dare to change all the internal occurences of the
#  program name. I still hope to find a better one...
#  where ever you find `typeset': don't wonder it's just the old name,
#  which was droped because some shells have it as an internal command.
#
## Where to install:

# BASE is just to make the usual case easier

prefix = /usr/local

## EXE is the name of the executable. As long as I don't find a good
# name ist's `sdc'.

EXE=sdc

## SR is the installation directory. Down from here the directory
# structure in used by typeset itself.
# This is the "logical" place of typeset, where users will find it.

SR = $(prefix)/lib/$(EXE)

## DD is the "destination directory" except for the documentation which
# is installed separatly no file is created outside. This is the pysical
# place of typeset.
# Usually this is the same as $(SR) 

DD = $(SR)

## internal adjustments

# Sgmls happens to forget the -i switches for subdoc's. If you use sgmls
# you need to undergo a HACK (which implies to haver write permissions
# into the first directory of your DOCPATH). Set the following to sgmls
# or nsgmls. (The latter will remove the hack at compile time).
#
# You can put the full path name here to save a little on execution time.
#
# Make absolutly sure that -- if you are using sgmls -- this points
# to a version 1.1.91 NOT 1.1 of sgmls!

PARSEPROG=sgmls

# The following decides whether or not some graphic converters are
# installed at the local host or called from a remote one. The latter
# is a rather complicated procedure, but localy nessesary at the host
# of developing. Pretty sure this should be "local" instead of
# "remote"

REMLOC=local

# GRPHPKG determines the graphic package to use for LaTeX
# either "grphcs" or "epsfig"
# Don't attempt to use epsfig in conjunction with LaTeX2e!

GRPHPKG=grphcs

# For custumization of installed documentation go to the Makefile of
# the doc directory!

## The installation process

# Make sure you have an echo which understands the -n option (Solaris is
# known to have a broken one, use /usr/ucb/echo on this system)

ECHO=echo

# Need something to make dirs and the path up to them. Either mkdir -p or
# install -d. For those who have an install which doesn't understand -d
# (e.g., Ultrix) there is one in the install directory.

MKDIR=install
#MKDIR=mkdir
#MKDIR=$(HOME)/build/$(EXE)/install/install
MKDIROPT=-d -o root -g root -m 755

# Need also a cp. Either cp or install.
#CP=cp
CP=$(HOME)/build/$(EXE)/install/install

MAKE=/usr/bin/make

# WWW is where the local home Web accessiable things go

#WWW=$(prefix)/www/doc/$(EXE)

#--------------------------------------------------------------------------
# There should be nothing to be changed below this line.
# -------------------------------------------------------------------------

# Private archive. Everything including RCS files
TARFILE = $(EXE).tz
# Release archive.
RTARFILE = $(EXE).tar.gz
# Mailable distribution
DISTFILE = $(EXE).uue

#SUBDIRS=`find ./* -maxdepth 0 -type d -print`
SUBDIRS=bin sgml include rc target doc

SETTINGS=prefix=$(prefix) SR=$(SR) DD=$(DD) EXE=$(EXE) \
	  WWW=$(WWW) INFO=$(INFO) MAN=$(MAN) \
	  PARSEPROG=$(PARSEPROG) \
	  MAKE=$(MAKE) CP=$(CP) \
	  MKDIR=$(MKDIR) MKDIROPT="$(MKDIROPT)" ECHO=$(ECHO)

.SUFFIXES: .sgml .html .lout

help:

prepare:	all

all: # prepare in place for install
all:
	$(ECHO) -n $(SR) > sgml/instdir
	$(MAKE) -C sgml SETTING=$(SETTINGS) prepare
#	V=`basename \`pwd\`|sed "s/^[a-z]*-//"` \
#		$(MAKE) -C bin VERSION=$$V SETTINGS=$(SETTINGS) $(EXE)
	$(MAKE) -C bin VERSION=1.0.8beta SETTINGS=$(SETTINGS) $(EXE)
	$(MAKE) -C bin REMLOC=$(REMLOC) GRPHPKG=$(GRPHPKG) \
		 SETTINGS=$(SETTINGS) converters
	rm sgml/instdir

install:: # public installation, do after make prepare
install::
	set -e; [ -d $(DD) ] || \
		$(MKDIR) $(MKDIROPT) $(DD)
	#chmod -R +w $(DD)
	set -e; for i in $(SUBDIRS); do \
		$(MAKE) -C $$i install $(SETTINGS); \
	done
	$(CP) Makefile *.data $(DD)
	$(ECHO) -n $(SR) > $(DD)/sgml/instdir

instbbset: # install bbset
instbbset:
	set -e; [ -d $(prefix)/bin ] || \
		$(MKDIR) $(MKDIROPT) $(prefix)/bin
	set -e; cd $(prefix)/bin && \
		$(SR)/bin/$(EXE) -V0 -O literate $(SR)/bin/bbset.sgml
	chmod +x $(prefix)/bin/bbset
	set -e; [ -d $(prefix)/man/man1 ] || \
		$(MKDIR) $(MKDIROPT) $(prefix)/man/man1
	set -e; cd $(prefix)/man/man1 && \
		 $(SR)/bin/$(EXE) -V0 -O man -o bbset.1	$(DD)/bin/bbset.sgml

uninstall: # remove installed files (except doc)
uninstall: #    don't forget to remove the local choosen link (which typeset)
uninstall:
	rm -rf $(DD)/*

installdoc:	# Install the documentation (only valid AFTER make install)
installdoc:	# custumize the Makefile of the doc directory before!
installdoc:	
	 $(MAKE) -C doc $(SETTINGS) doc

# Some development aid

homepg:	# prepare the home page
	sed -e s%@@VERSION@@%`pwd | sed -e "s/^.*-//" `%g homepage.sgml \
		>homepage.tmp
	$(EXE) -V0 -o $(WWW)/index.html -O html homepage.tmp
	rm homepage.tmp

INSTALL: # prepare the INSTALL file (not installation)
INSTALL: doc/INSTALL.sgml
	$(EXE) -L . -V0 -D doc -Oascii -Rno-margin\
		-o INSTALL doc/INSTALL.sgml

README: # prepare the README file
README: doc/README.sgml
	$(EXE) -L . -V0 -D doc -Oascii -Rno-margin\
		-o README doc/README.sgml

# archive and something like that

FINDFILES = -name "*" ! -type d ! -name "*~" ! -name "*.bak" \
	! -path "*/CVS/*" \
	! -name core ! -name "*.o" ! -name "$(EXE)" ! -path "./install/*" \
	! -name $(TARFILE)

list:
	find . $(FINDFILES) -print > FILES

filelist: force
	@find $(FINDFILES) -print

listafter: force
	set -e; [ -f $(AFTER) ] && \
		find -newer $(AFTER) $(FINDFILES) -print

$(TARFILE): FILES
	tar -czv --files-from FILES -f $(TARFILE)

tar:	# archivieren
	rm -f FILES
	make $(TARFILE)

xtar:	# Archiv auspacken
	chmod -R +w *
	tar xzvf $(TARFILE)

# tricky: assemble the release.
$(DISTFILE): RELEASEFILES INSTALL README
	cp RELEASEFILES rRELEASEFILES
	$(ECHO) ./AllDoc.ps >>rRELEASEFILES
	cp $(WWW)/AllDoc.ps .
	sed "s/^\./$(DIREC)/" rRELEASEFILES >xRELEASEFILES
	set -e; cd .. && \
		tar -czvf $(DIREC)/$(RTARFILE) \
		  --files-from $(DIREC)/xRELEASEFILES
	rm rRELEASEFILES xRELEASEFILES AllDoc.ps
	uuencode $(RTARFILE) $(RTARFILE) > $(WWW)/$(DISTFILE) 
	mv $(RTARFILE) $(WWW)

dist:	# create the distribution
dist:
	$(MAKE) $(DISTFILE) DIREC=`basename \`pwd\`` prefix=$(prefix)

clean:	# remove redundant files
	@touch core
	rm -f `find . \( -name "*~" -o -name *.o -o -name core \) -print`
	rm -f sgml/instdir


clobber: # remove all generated files (did I catch all?)
clobber: clean
	set -e; for i in $(SUBDIRS); do \
		$(MAKE) -C $$i clobber; \
	done

purge:	# same as clean & removes files containing only "deleted"
purge:  clean
	@$(ECHO) -n deleted	>deleted7
	@$(ECHO) deleted	>deleted8
	@rm -f `find . \
	       \( \( -size 8c -exec cmp -s {} deleted8 \; \)	\
	       -o \( -size 7c -exec cmp -s {} deleted7 \; \) \)	\
	       -print`
	@echo purged

wipe:	# use: make wipe file=<file> # prepares file for purge
	mv -f $(file) $(file)~
	echo deleted >$(file)

e.dd+pwd:
	set -e; [ -d $(DD) ] || \
		$(MKDIR) $(MKDIROPT) $(DD)/`basename \`pwd\``

force:

help:	# Help on make targets
	@echo Recommented: either edit the settings of the Makefile variables
	@echo prefix SR DD
	@echo as explaint in the comments of the Makefile or
	@echo just call the targets like
	@echo make prefix=\<basedir\> \<target\>
	@echo ------------------------------
	-@egrep "^[A-Za-z\._]+::?.*#" [Mm]akefile

# Local Variables:
# outline-regexp: ".+:[ \t]+#"
# End: