freedoom/Makefile

131 lines
4.5 KiB
Makefile
Raw Normal View History

2014-09-18 11:51:03 -07:00
# Copyright (c) 2001-2014
# Contributors to the Freedoom project. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the freedoom project nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-05-09 09:20:42 -07:00
VERSION=$(shell git describe 2>/dev/null || cat VERSION)
WADS=wads
CPP=scripts/simplecpp
DEUTEX=deutex
2008-12-26 09:47:14 -08:00
DEUTEX_BASIC_ARGS=-v0 -fullsnd -rate accept -rgb 0 255 255
2006-05-09 09:20:42 -07:00
DEUTEX_ARGS=$(DEUTEX_BASIC_ARGS) -doom2 bootstrap/
FREEDOOM1=$(WADS)/freedoom1.wad
FREEDOOM2=$(WADS)/freedoom2.wad
FREEDM=$(WADS)/freedm.wad
OBJS=$(FREEDM) $(FREEDOOM1) $(FREEDOOM2)
2006-05-09 09:20:42 -07:00
all: $(OBJS)
2006-05-09 09:20:42 -07:00
subdirs:
$(MAKE) -C graphics/text
$(MAKE) VERSION=$(VERSION) -C graphics/titlepic
$(MAKE) -C lumps/cph/misc-lumps
$(MAKE) -C lumps/genmidi
$(MAKE) -C lumps/dmxgus
$(MAKE) -C lumps/textures
2006-05-09 09:20:42 -07:00
# this is a useless dependency to force builds
force:
lumps/freedoom.lmp lumps/freedm.lmp: force
echo $(VERSION) > $@
2006-05-09 09:20:42 -07:00
# update wadinfo.txt
wadinfo.txt: buildcfg.txt subdirs lumps/freedoom.lmp
$(CPP) -P -DDOOM2 < $< | scripts/wadinfo-builder.py > $@
wadinfo_phase1.txt: buildcfg.txt subdirs lumps/freedoom.lmp
$(CPP) -P -DDOOM1 -DULTDOOM < $< | scripts/wadinfo-builder.py -dummy > $@
wadinfo_phase2.txt: buildcfg.txt subdirs lumps/freedoom.lmp
$(CPP) -P -DDOOM2 < $< | scripts/wadinfo-builder.py -dummy > $@
wadinfo_freedm.txt : buildcfg.txt subdirs lumps/freedoom.lmp lumps/freedm.lmp
$(CPP) -P -DFREEDM < $< | scripts/wadinfo-builder.py -dummy > $@
2006-05-09 09:20:42 -07:00
%.wad.gz: %.wad
gzip < $< > $@
chmod o-r $<
md5sum $<.gz > $<.md5sum
rm -f $<
# deutex doesnt allow redirects for the filenames in the texture
# entries, so we have to change the texture1 symlink to point
# to whichever wad we are working on
#---------------------------------------------------------
# freedm iwad
$(FREEDM): wadinfo_freedm.txt subdirs
@mkdir -p $(WADS)
rm -f $@
$(DEUTEX) $(DEUTEX_ARGS) -iwad -build wadinfo_freedm.txt $@
2006-05-09 09:20:42 -07:00
#---------------------------------------------------------
# phase 1 (udoom) iwad
2006-05-09 09:20:42 -07:00
$(FREEDOOM1): wadinfo_phase1.txt subdirs
@mkdir -p $(WADS)
2006-05-09 09:20:42 -07:00
rm -f $@
$(DEUTEX) $(DEUTEX_ARGS) -iwad -lumps -patch -flats -sounds -musics -graphics -sprites -levels -build wadinfo_phase1.txt $@
2006-05-09 09:20:42 -07:00
#---------------------------------------------------------
# phase 2 (doom2) iwad
$(FREEDOOM2): wadinfo_phase2.txt subdirs
@mkdir -p $(WADS)
rm -f $@
$(DEUTEX) $(DEUTEX_ARGS) -iwad -lumps -patch -flats -sounds -musics -graphics -sprites -levels -build wadinfo_phase2.txt $@
doc: BUILD-SYSTEM.adoc README.adoc
asciidoc BUILD-SYSTEM.adoc
asciidoc README.adoc
DISTDOCS=COPYING CREDITS README.html
# Due to convoluted reasons, the WADs must directly proceed the game name.
dist: $(OBJS) doc
VERSION=$(VERSION) scripts/makepkgs freedm $(FREEDM) $(DISTDOCS)
VERSION=$(VERSION) scripts/makepkgs freedoom $(FREEDOOM1) $(FREEDOOM2) $(DISTDOCS)
clean:
rm -f *.html deutex.log $(OBJS) \
./wadinfo.txt ./wadinfo_phase1.txt \
./wadinfo_phase2.txt ./wadinfo_freedm.txt \
./lumps/freedoom.lmp \
./lumps/freedm.lmp
-rmdir $(WADS)
$(MAKE) -C graphics/text clean
$(MAKE) -C graphics/titlepic clean
$(MAKE) -C lumps/cph/misc-lumps clean
$(MAKE) -C lumps/genmidi clean
$(MAKE) -C lumps/dmxgus clean
$(MAKE) -C lumps/textures clean