update makefile for new code structure

This commit is contained in:
GenZmeY 2020-08-07 07:30:34 +03:00
parent 376db163b1
commit a958f1bccb

View File

@ -39,6 +39,9 @@ BINDIR = $(BUILDROOT)$(PREFIX)/bin
SBINDIR = $(BUILDROOT)$(PREFIX)/sbin
GAMEDIR = $(BUILDROOT)$(PREFIX)/games
DATADIR = $(BUILDROOT)$(PREFIX)/share
SCRIPTDIR = $(DATADIR)/$(NAME)
SCRIPTGRPDIR = $(SCRIPTDIR)/cmdgrp
SCRIPTLIBDIR = $(SCRIPTDIR)/lib
LICENSEDIR = $(DATADIR)/licenses/$(NAME)
KF2MAINDIR = $(GAMEDIR)/$(NAME)
KF2BETADIR = $(GAMEDIR)/$(NAME)-beta
@ -84,11 +87,29 @@ filesystem:
test -d '$(FIREWALLDDIR)' || install -m 755 -d '$(FIREWALLDDIR)'
test -d '$(LOGROTATEDIR)' || install -m 755 -d '$(LOGROTATEDIR)'
test -d '$(RSYSLOGDIR)' || install -m 755 -d '$(RSYSLOGDIR)'
test -d '$(SCRIPTGRPDIR)' || install -m 755 -d '$(SCRIPTGRPDIR)'
test -d '$(SCRIPTLIBDIR)' || install -m 755 -d '$(SCRIPTLIBDIR)'
install: filesystem build
install -m 755 $(RELEASEDIR)/main/$(NAME) $(BINDIR)
install -m 755 $(RELEASEDIR)/main/$(NAME)-beta $(BINDIR)
# ugly, but works
find $(RELEASEDIR)/main/cmdgrp \
-mindepth 1 \
-maxdepth 1 \
-type d \
-printf "%f\n" | \
while read CmdGrp; \
do \
pushd $(RELEASEDIR)/main/cmdgrp/$$CmdGrp; \
install -m 755 -d $(SCRIPTGRPDIR)/$$CmdGrp; \
install -m 644 * $(SCRIPTGRPDIR)/$$CmdGrp; \
popd; \
done
install -m 644 $(RELEASEDIR)/main/lib/* $(SCRIPTLIBDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta@.service $(UNITDIR)
install -m 644 $(RELEASEDIR)/main/systemd/$(NAME)-beta-update.service $(UNITDIR)
@ -151,6 +172,32 @@ test: fake-systemd-build
$(BASHCHECK) $(RELEASEDIR)/main/$(NAME)-beta
$(BASHCHECK) $(RELEASEDIR)/force-attr/$(NAME)-force-attr
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/ban/list
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/ban/add
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/ban/delete
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/ban/sync
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/game/update
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/game/validate
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/game/fix-permissions
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/game/run
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/list
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/add
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/delete
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/enable
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/disable
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/start
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/stop
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/restart
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/instance/chat
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/maprotate/save
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/maprotate/load
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/password/game
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/password/admin
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/workshop/list
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/workshop/add
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/workshop/delete
$(BASHCHECK) $(RELEASEDIR)/main/cmdgrp/workshop/sync
clean:
rm -rf $(RELEASEDIR)