make system cleanup
This commit is contained in:
+4
-90
@@ -4,7 +4,7 @@
|
||||
|
||||
WANT_WASM=1
|
||||
WASM_DEBUG=1
|
||||
WASM_DATA_DIR=$(NHSROOT)/src/wasm-data/Users/ampower/nethackdir
|
||||
WASM_DATA_DIR=$(NHSROOT)/src/wasm-data
|
||||
|
||||
# toolchain
|
||||
EMCC=emcc
|
||||
@@ -51,100 +51,14 @@ else
|
||||
EMCC_CFLAGS+=$(EMCC_PROD_CFLAGS)
|
||||
endif
|
||||
|
||||
ifdef WANT_SHARE_INSTALL
|
||||
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
|
||||
# we install into ~/nethackdir
|
||||
ifeq ($(GAMEUID),root)
|
||||
PREFIX:=/Library/NetHack
|
||||
SHELLDIR=/usr/local/bin
|
||||
HACKDIR=$(PREFIX)/nethackdir
|
||||
CHOWN=chown
|
||||
CHGRP=chgrp
|
||||
# We run sgid so the game has access to both HACKDIR and user preferences.
|
||||
GAMEPERM = 02755
|
||||
else # ! root
|
||||
PREFIX:=/Users/$(GAMEUID)
|
||||
SHELLDIR=$(PREFIX)/bin
|
||||
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0500
|
||||
endif # ! root
|
||||
VARFILEPERM = 0664
|
||||
VARDIRPERM = 0775
|
||||
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
|
||||
# XXX it's nice we don't write over sysconf, but we've already erased it
|
||||
# make sure we have group GAMEUID and group GAMEGRP
|
||||
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); \
|
||||
. sys/unix/hints/macosx.sh group2 $(GAMEGRP); \
|
||||
mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; \
|
||||
$(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; \
|
||||
$(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; \
|
||||
chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
|
||||
|
||||
else ifdef WANT_SOURCE_INSTALL
|
||||
|
||||
PREFIX=$(abspath $(NHSROOT))
|
||||
# suppress nethack.sh
|
||||
#SHELLDIR=
|
||||
HACKDIR=$(PREFIX)/playground
|
||||
# installation config
|
||||
# hackdir is the wasm / emscripten embed data root directory
|
||||
HACKDIR=/
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0700
|
||||
VARFILEPERM = 0600
|
||||
VARDIRPERM = 0700
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
|
||||
# We can use "make all" to build the whole thing - but it misses some things:
|
||||
MOREALL=$(MAKE) install
|
||||
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||
|
||||
else # !WANT_SOURCE_INSTALL
|
||||
|
||||
PREFIX:=$(wildcard ~)
|
||||
SHELLDIR=$(PREFIX)/bin
|
||||
HACKDIR=$(PREFIX)/nethackdir
|
||||
CHOWN=/usr/bin/true
|
||||
CHGRP=/usr/bin/true
|
||||
GAMEPERM = 0700
|
||||
VARFILEPERM = 0600
|
||||
VARDIRPERM = 0700
|
||||
ifdef ($(WANT_DEFAULT),X11)
|
||||
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
|
||||
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
|
||||
endif # WANT_DEFAULT X11
|
||||
|
||||
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; \
|
||||
$(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; \
|
||||
$(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; \
|
||||
chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
|
||||
ifdef WANT_BUNDLE
|
||||
#
|
||||
# Bundle
|
||||
#
|
||||
# $(HACKDIR)/$(GAME).app/
|
||||
# Contents/
|
||||
# Frameworks/
|
||||
# Info.plist
|
||||
# MacOS/
|
||||
# $(GAME)
|
||||
# PkgInfo/
|
||||
# PlugIns/
|
||||
# Resources/
|
||||
# SharedFrameWorks/
|
||||
#
|
||||
BUNDLE = mkdir -p $(HACKDIR)/nethack.app/Contents/MacOS; \
|
||||
sys/unix/hints/macosx.sh infoplist > $(HACKDIR)/nethack.app/Contents/Info.plist; \
|
||||
mv $(HACKDIR)/nethack $(HACKDIR)/nethack.app/Contents/MacOS/nethack;
|
||||
ifdef WANT_SHARE_INSTALL
|
||||
BUNDLE+= chmod $(GAMEPERM) $(HACKDIR)/nethack.app/Contents/MacOS/nethack;
|
||||
endif
|
||||
|
||||
POSTINSTALL+= $(BUNDLE)
|
||||
POSTINSTALL+= if test -f $(SHELLDIR)/$(GAME); then \
|
||||
sed -i '' 's;HACKDIR/$(GAME);HACKDIR/$(GAME).app/Contents/MacOS/$(GAME);' $(SHELLDIR)/$(GAME) ; fi;
|
||||
endif # WANT_BUNDLE
|
||||
endif # !WANT_SHARE_INSTALL
|
||||
|
||||
INSTDIR=$(HACKDIR)
|
||||
VARDIR=$(HACKDIR)
|
||||
|
||||
Reference in New Issue
Block a user