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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
|
# Makefile of DeuTex/DeuSF
# by Per Allansson, Olivier Montanuy and Andr Majorel
#
# Platform-specific notes:
#
# Unix User targets should work on all Unices. Some _developer_
# targets, however, require Elinks, GCC or GNU tar and gzip.
#
# DOS "make [all]" should work with DJGPP and Cygwin. With other
# compilers, use the batch files in dos\ instead.
# "make install" will most likely not work ; install the
# executables by hand.
#
# Others Don't know. Send feedback to the maintainer.
#
# Compiled by developers
DCFLAGS = -g -Wall -Wpointer-arith -Wstrict-prototypes -pg
DCC = gcc
DLDFLAGS = -g -pg
#DEFINES = -DDT_ALPHA -DDT_PRIVATE
#DEFINES = -DDT_PRIVATE
######### do not edit after this line #########
VERSION = `cat VERSION`
DISTARC = deutex-$(VERSION).tar.gz
DISTARCDOS = deutex-$(VERSION).zip
DISTARCDOS8 = dtex`tr -cd '[0-9]' <VERSION`.zip
BINZIP = deutex-$(VERSION).bin.dos.zip
DISTDIR = deutex-$(VERSION)
DISTDIRDOS = dtex`tr -cd '[0-9]' <VERSION`
DISTFILES = $(DOC_SRC) $(HEADERS) $(MISCFILES) $(MISCSRC)\
$(SCRIPTS) $(SRC)
DISTFILESBIN = $(MISCFILES) deutex.exe deusf.exe
DOC_SRC =\
docsrc/README\
docsrc/changes.html\
docsrc/deutex.6\
docsrc/faq.html\
docsrc/hackers_guide.html\
docsrc/readme.dos\
docsrc/todo.html\
docsrc/transpblue.png
DDOCUNIXFILES =\
unixtmp1/CHANGES\
unixtmp1/COPYING\
unixtmp1/COPYING.LIB\
unixtmp1/FAQ\
unixtmp1/INSTALL\
unixtmp1/LICENCE\
unixtmp1/README\
unixtmp1/TODO\
unixtmp1/deutex.6\
unixtmp1/dtexman6.txt
DDOCUNIX = unixtmp1 $(DDOCUNIXFILES)
DDOCDOSFILES =\
dostmp1/changes.txt\
dostmp1/copying\
dostmp1/copying.lib\
dostmp1/dtexman6.txt\
dostmp1/faq.txt\
dostmp1/install.txt\
dostmp1/licence.txt\
dostmp1/manpage.txt\
dostmp1/readme.txt\
dostmp1/todo.txt
DDOCDOS = dostmp1 $(DDOCDOSFILES)
HEADERS =\
src/color.h\
src/deutex.h\
src/endianio.h\
src/endianm.h\
src/extract.h\
src/gifcodec.h\
src/ident.h\
src/lists.h\
src/log.h\
src/merge.h\
src/mkwad.h\
src/picture.h\
src/sound.h\
src/sscript.h\
src/text.h\
src/texture.h\
src/tools.h\
src/usedidx.h\
src/wadio.h
MISCFILES =\
VERSION
# Only in source distributions
MISCSRC =\
Makefile.in\
configure\
dos/buildbc.bat\
dos/builddj.bat\
dos/buildmsc.bat\
old/deusf.ide\
old/deutex.ide\
old/dos2unix.sh\
old/save.bat\
src/deusf.def\
src/deusfos.def\
src/deutex.def\
src/deutexos.def
SCRIPTS =\
scripts/codes\
scripts/html2txt\
scripts/process
SRC =\
src/color.c\
src/compose.c\
src/deutex.c\
src/endianio.c\
src/endianm.c\
src/extract.c\
src/gifcodec.c\
src/ident.c\
src/listdir.c\
src/lists.c\
src/log.c\
src/lzw.c\
src/merge.c\
src/mkwad.c\
src/picture.c\
src/sound.c\
src/sscript.c\
src/substit.c\
src/text.c\
src/texture.c\
src/tools.c\
src/usedidx.c\
src/version.c\
src/wadio.c
OBJSF = $(SRC:.c=.os)
OBJTEX = $(SRC:.c=.ot)
DOBJSF = $(SRC:.c=.osd)
DOBJTEX = $(SRC:.c=.otd)
MSGTEX = $(SRC:.c=.mt)
.SUFFIXES: .mt .os .os~ .ot .ot~ .osd .osd~ .otd .otd~ $(SUFFIXES)
.c.ot: src/deutex.h
$(CC) $(CFLAGS) $(DEFINES) -DDeuTex -o $@ -c $<
.c.os: src/deutex.h
$(CC) $(CFLAGS) $(DEFINES) -DDeuSF -o $@ -c $<
.c.otd: src/deutex.h
$(DCC) $(DCFLAGS) $(DEFINES) -DDeuTex -o $@ -c $<
.c.osd: src/deutex.h
$(DCC) $(DCFLAGS) $(DEFINES) -DDeuSF -o $@ -c $<
.c.mt: src/deutex.h
scripts/codes $< >$@. && mv $@. $@
all: deutex deusf
deutex: $(OBJTEX) tmp/_deutex
$(CC) $(LDFLAGS) -o deutex $(OBJTEX) -lm
deusf: $(OBJSF) tmp/_deusf
$(CC) $(LDFLAGS) -o deusf $(OBJSF) -lm
dall: ddeutex ddeusf
ddt: ddeutex
dds: ddeusf
ddeutex: $(DOBJTEX)
$(DCC) $(DLDFLAGS) -lm -o deutex $(DOBJTEX)
@# Force next "make deutex" to relink
(sleep 1; mkdir -p tmp; >tmp/_deutex) &
ddeusf: $(DOBJSF)
$(DCC) $(DLDFLAGS) -lm -o deusf $(DOBJSF)
@# Force next "make deusf" to relink
(sleep 1; mkdir -p tmp; >tmp/_deusf) &
tmp/_deutex:
[ -d tmp ] || mkdir tmp
>$@
tmp/_deusf:
[ -d tmp ] || mkdir tmp
>$@
install:
install -p -m 0755 deutex $(BINDIR)
install -p -m 0755 deusf $(BINDIR)
install -p -m 0644 deutex.6 $(MANDIR)/man6
if [ -d $(MANDIR)/man6/deusf.6 ]; then rmdir $(MANDIR)/man6/deusf.6; fi
ln -sf deutex.6 $(MANDIR)/man6/deusf.6
src/version.c: VERSION
printf "const char deutex_version[] = \"%s\";\n" $(VERSION) >$@
strip: deutex deusf
strip deutex
strip deusf
msg: msgtex
msgtex: $(MSGTEX)
doc: $(DDOCUNIX)
unixtmp1:
mkdir -p $@
unixtmp1/CHANGES: docsrc/changes.html VERSION
scripts/html2txt docsrc/changes.html >$@_ && mv $@_ $@
unixtmp1/COPYING: docsrc/COPYING
cp -p docsrc/COPYING $@
unixtmp1/COPYING.LIB: docsrc/COPYING.LIB
cp -p docsrc/COPYING.LIB $@
unixtmp1/FAQ: docsrc/faq.html VERSION
echo 'THIS IS A GENERATED FILE -- DO NOT EDIT !' >$@.1
printf 'Edit docsrc/faq.html instead.\n\n' >>$@.1
links -dump docsrc/faq.html >>$@.1
sed 's/^ //; s/^ //' $@.1 >$@.2
rm -f $@.1
mv $@.2 $@
unixtmp1/INSTALL: docsrc/INSTALL VERSION scripts/process
scripts/process docsrc/INSTALL >$@
unixtmp1/LICENCE: docsrc/LICENCE VERSION scripts/process
scripts/process docsrc/LICENCE >$@
unixtmp1/README: docsrc/README VERSION scripts/process
scripts/process docsrc/README >$@
unixtmp1/TODO: docsrc/todo.html VERSION
echo 'THIS IS A GENERATED FILE -- DO NOT EDIT !' >$@.1
printf 'Edit docsrc/todo.html instead.\n\n' >>$@.1
links -dump docsrc/todo.html >>$@.1
sed 's/^ //' $@.1 >$@.2
rm -f $@.1
mv $@.2 $@
unixtmp1/deutex.6: docsrc/deutex.6 VERSION unixtmp1/deutex.6.opt\
unixtmp1/deutex.6.diag scripts/process
scripts/process docsrc/deutex.6 >$@
unixtmp1/deutex.6.diag:
echo 'FIXME \-\- not implemented yet' >$@
unixtmp1/deutex.6.opt: deutex
./deutex -man >$@
unixtmp1/dtexman6.txt: docsrc/dtexman6.txt
cp -p docsrc/dtexman6.txt $@
dostmp1:
mkdir -p $@
dostmp1/changes.txt: unixtmp1/CHANGES
todos <unixtmp1/CHANGES >$@
touch -r unixtmp1/CHANGES $@
dostmp1/copying: unixtmp1/COPYING
todos <unixtmp1/COPYING >$@
touch -r unixtmp1/COPYING $@
dostmp1/copying.lib: unixtmp1/COPYING.LIB
todos <unixtmp1/COPYING.LIB >$@
touch -r unixtmp1/COPYING.LIB $@
dostmp1/dtexman6.txt: unixtmp1/dtexman6.txt
todos <unixtmp1/dtexman6.txt >$@
touch -r unixtmp1/dtexman6.txt $@
dostmp1/faq.txt: unixtmp1/FAQ
todos <unixtmp1/FAQ >$@
touch -r unixtmp1/FAQ $@
dostmp1/install.txt: docsrc/INSTALL VERSION scripts/process
scripts/process docsrc/INSTALL | todos >$@
dostmp1/licence.txt: unixtmp1/LICENCE
todos <unixtmp1/LICENCE >$@
touch -r unixtmp1/LICENCE $@
dostmp1/manpage.txt: unixtmp1/deutex.6
nroff -man -Tlatin1 unixtmp1/deutex.6 | ul -t dumb | todos >$@
touch -r unixtmp1/deutex.6 $@
dostmp1/readme.txt: docsrc/README VERSION scripts/process
scripts/process docsrc/README | todos >$@
dostmp1/readme-bin.txt: docsrc/readme.dos VERSION scripts/process
scripts/process docsrc/readme.dos | todos >$@
dostmp1/todo.txt: unixtmp1/TODO
todos <unixtmp1/TODO >$@
touch -r unixtmp1/TODO $@
clean:
rm -f $(OBJTEX) $(OBJSF) $(DOBJTEX) $(DOBJSF) deutex deusf
rm -f deutex.exe deusf.exe
# dist - make the distribution archive for Unix (.tar.gz)
dist: $(DISTFILES) $(DDOCUNIX)
mkdir -p $(DISTDIR)
tar cf - $(DISTFILES) | (cd $(DISTDIR) && tar xvf -)
cp -p $(DDOCUNIXFILES) $(DISTDIR)
tar -zcf $(DISTARC) $(DISTDIR)
rm -rf $(DISTDIR)
# distdos - make the distribution archive DOS (.zip, 8+3)
distdos: $(DISTFILES) $(DDOCDOS)
mkdir -p $(DISTDIRDOS)
tar cf - $(DISTFILES) | (cd $(DISTDIRDOS) && tar xvf -)
cp -p $(DDOCDOSFILES) $(DISTDIRDOS)
if [ -e $(DISTARCDOS) ]; then rm $(DISTARCDOS); fi
zip -D -X -9 -r $(DISTARCDOS) $(DISTDIRDOS)
rm -rf $(DISTDIRDOS)
printf 'DeuTex %s\nhttp://www.teaser.fr/~amajorel/deutex/'\
"$(VERSION)" | zip -z $(DISTARCDOS)
# distbindos - make the DOS binary distribution archive (.zip, 8+3)
TMP=tmpd
distbindos: $(DISTFILESBIN) $(DDOCDOS) dostmp1/readme-bin.txt
mkdir -p $(TMP)
cp -dpP $(DISTFILESBIN) $(TMP)
cp -p $(DDOCDOSFILES) $(TMP)
# Use a different readme.txt because this is a binary distribution
cp -p dostmp1/readme-bin.txt $(TMP)/readme.txt
# INSTALL is irrelevant to binary distributions
rm -f $(TMP)/install.txt
if [ -e $(BINZIP) ]; then rm $(BINZIP); fi
export name=`pwd`/$(BINZIP); cd $(TMP); zip -D -X -9 -R $$name '*'
rm -rf $(TMP)
printf 'DeuTex %s\nhttp://www.teaser.fr/~amajorel/deutex/'\
"$(VERSION)" | zip -z $(BINZIP)
# save - your daily backup
save:
tar -czvf ../deutex-`date '+%Y%m%d'`.tar.gz\
--exclude dostmp1 --exclude unixtmp1\
--exclude "*~" --exclude "*.o"\
--exclude "*.os" --exclude "*.ot"\
--exclude "*.osd" --exclude "*.otd"\
--exclude "*.obj" .
# help - display list of interesting targets
help:
@echo "Targets for end users:"
@echo " [all] Build DeuTex and DeuSF"
@echo " install Install DeuTex, DeuSF and the doc"
@echo
@echo "Targets for developers:"
@echo " doc Just the doc"
@echo " dall Alias for ddeutex + ddeusf"
@echo " ddt Alias for ddeutex"
@echo " dds Alias for ddeusf"
@echo " ddeutex Debug version of DeuTex -> ./deutex"
@echo " ddeusf Debug version of DeuSF -> ./deusf"
@echo " dist Source dist. (Unix) -> ./deutex-VERSION.tar.gz"
@echo " distdos Source dist. (DOS) -> ./dtexVERSION.zip"
@echo " distbindos Binary-only dist. (DOS) -> ./deutex-VERSION.bin.dos.zip"
@echo " save Backup archive -> ../deutex-YYYYMMDD.tar.gz"
@echo " strip Strip ./deutex and ./deusf"
@echo " test Run all tests (long)"
@echo " clean Remove executables and object files"
|