moth/Makefile

49 lines
1.3 KiB
Makefile
Raw Normal View History

2009-09-29 15:36:25 -06:00
DESTDIR = target
CTFDIR = $(DESTDIR)/usr/lib/ctf
WWWDIR = $(DESTDIR)/usr/lib/www
FAKE = fakeroot -s fake -i fake
INSTALL = $(FAKE) install
PYC = config.pyc points.pyc game.pyc teams.pyc
PYC += register.pyc scoreboard.pyc puzzler.pyc
PYC += flagd.pyc pointsd.pyc pointscli.pyc
PYC += roshambo.pyc histogram.pyc
all: ctf.tce
target: $(PYC)
$(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf
$(INSTALL) -d $(DESTDIR)/var/lib/ctf/disabled
2009-10-01 13:52:34 -06:00
touch $(DESTDIR)/var/lib/ctf/disabled/survey
2009-09-29 15:36:25 -06:00
$(INSTALL) -d $(CTFDIR)
$(INSTALL) $(PYC) $(CTFDIR)
2009-09-30 13:58:16 -06:00
$(INSTALL) ctfd.py $(CTFDIR)
2009-09-29 15:36:25 -06:00
$(INSTALL) -d $(WWWDIR)
2009-10-01 12:17:03 -06:00
$(INSTALL) index.html intro.html ctf.css grunge.png $(WWWDIR)
2009-09-29 15:36:25 -06:00
$(FAKE) ln -s /var/lib/ctf/histogram.png $(WWWDIR)
$(INSTALL) register.cgi scoreboard.cgi puzzler.cgi $(WWWDIR)
$(INSTALL) -d $(DESTDIR)/var/service/ctf
2009-09-30 13:58:16 -06:00
$(INSTALL) run.ctfd $(DESTDIR)/var/service/ctf/run
2009-09-29 15:36:25 -06:00
2009-10-01 12:17:03 -06:00
$(INSTALL) -d $(DESTDIR)/var/service/ctf/log
$(INSTALL) run.log.ctfd $(DESTDIR)/var/service/ctf/log/run
2009-09-29 15:36:25 -06:00
rm -rf $(WWWDIR)/puzzler
$(INSTALL) -d $(WWWDIR)/puzzler
./mkpuzzles.py --htmldir=$(WWWDIR)/puzzler --keyfile=$(CTFDIR)/puzzler.keys
ctf.tce: target
$(FAKE) sh -c 'cd target && tar -czf - --exclude=placeholder --exclude=*~ .' > $@
clean:
rm -rf target
rm -f fake ctf.tce $(PYC)
%.pyc: %.py
python3 -c 'import $*'