From f7987cbd1642ae9ecd9d79138de00980a0504624 Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 8 Nov 2012 04:07:10 +0200 Subject: [PATCH] added 'install' target --- Jamrules | 5 ++++ Jamrules.configure | 14 ++++++++++ Jamrules.install | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 Jamrules.install diff --git a/Jamrules b/Jamrules index 705bd45..9192313 100644 --- a/Jamrules +++ b/Jamrules @@ -7,6 +7,10 @@ set-target-locations ; softinclude $(TOP)/Jamrules.configure ; +if ! $(PREFIX) { PREFIX = /usr/local ; } +DEFINES += "DATA_DIR=\\\"$(PREFIX)/share/awish\\\"" ; + + HDRS += $(TOP)/src ; @@ -31,6 +35,7 @@ if $(WINDOZE) { include $(TOP)/Jamrules.awish ; include $(TOP)/Jamrules.genvmd ; +include $(TOP)/Jamrules.install ; softinclude $(TOP)/Jamrules.push ; diff --git a/Jamrules.configure b/Jamrules.configure index 1791c34..fece301 100644 --- a/Jamrules.configure +++ b/Jamrules.configure @@ -2,6 +2,8 @@ rule -configure-options-help- { Echo "jam configure supports:" ; Echo " --prefix=dir [/usr/local]" ; Echo " --disable-sound disable sound support" ; + Echo " --install-awasm install Awish assembler" ; + Echo " --install-vmsrc install Awish VM source" ; Exit "" ; } @@ -23,6 +25,14 @@ rule -configure-options-with-tools- { BUILD_TOOLS = tan ; } +rule -configure-options-install-awasm- { + INSTALL_AWASM = tan ; +} + +rule -configure-options-install-vmsrc- { + INSTALL_VMSRC = tan ; +} + rule -configure- { -configure-pkg-config- "SDL" : sdl : : : "you need SDL to compile this!" ; @@ -33,6 +43,8 @@ rule -configure- { } -configure-add-line- "WITH_TITLE =" "$(WITH_TITLE)" ";" ; -configure-add-line- "BUILD_TOOLS =" "$(BUILD_TOOLS)" ";" ; + -configure-add-line- "INSTALL_AWASM =" "$(INSTALL_AWASM)" ";" ; + -configure-add-line- "INSTALL_VMSRC =" "$(INSTALL_VMSRC)" ";" ; } @@ -40,6 +52,8 @@ rule -configure-preinit- { WITH_TITLE = ; NOSOUND = ; BUILD_TOOLS = ; + INSTALL_AWASM = ; + INSTALL_VMSRC = ; } diff --git a/Jamrules.install b/Jamrules.install new file mode 100644 index 0000000..5ae65d9 --- /dev/null +++ b/Jamrules.install @@ -0,0 +1,75 @@ +# $(1): gristed source file +# $(2): source file +# $(3): directory to install +# $(LOCATE): the same as $(2) -- can be used in actions +rule InstallUserDefined { + switch $(2) { + case */libs/lib*.bob : + #Echo "bob library: $(2)" ; + InstallUninistall $(2:S=.bbo) : $(3) ; + if $(BUILDSO) { + InstallBobLibraryBSO $(1) : $(2) ; + } else { + InstallBobLibrary $(1) : $(2) ; + } + REALFILE on $(1) = $(2:S=.bbo) ; + # + InstallUserChown $(1) : $(2:S=.bbo) ; + InstallUserChgrp $(1) : $(2:S=.bbo) ; + # + if $(INSTALLLIBSSRC) { + InstallUninistall $(2) : $(3) ; + InstallBobLibrarySrc $(1) : $(2) ; + InstallUserChown $(1) : $(2) ; + InstallUserChgrp $(1) : $(2) ; + } + ## + #InstallUserChmod $(1) : $(2:S=.bbo) : +x ; + # + return 1 ; + } + return "" ; +} + + +actions quietly InstallBobLibrarySrc { + echo installing bob library src: $(>) "->" $(LOCATE) + $(CP) $(>) $(LOCATE) +} + + +actions quietly InstallBobLibrary { + $(TOP)/bob -c $(>) + echo installing bob library bso: $(REALFILE) "->" $(LOCATE) + $(CP) $(REALFILE) $(LOCATE) +} + + +actions quietly InstallBobLibraryBSO { + #echo "compiling '`basename \"$(>)\"`'" + LD_LIBRARY_PATH="$(TOP)/libs/" $(TOP)/bob -c $(>) + echo installing bob library bso: $(REALFILE) "->" $(LOCATE) + $(CP) $(REALFILE) $(LOCATE) +} + + +InstallBin bin : $(TOP)/awish ; +if $(INSTALL_AWASM) { InstallBin bin : $(TOP)/awasm ; } +InstallFile share/awish/data/sprites : $(TOP)/data/sprites/cursors.spr ; +InstallFile share/awish/data/code : $(TOP)/data/code/awish.vmd ; + +if [ FileExists $(TOP)/data/RESOURCE.DAT ] { InstallFile share/awish/data : $(TOP)/data/RESOURCE.DAT ; } +if [ FileExists $(TOP)/data/RESOURCE.SND ] { InstallFile share/awish/data : $(TOP)/data/RESOURCE.SND ; } + +if $(INSTALL_VMSRC) { + InstallFile share/awish/asm : [ Glob $(TOP)/asm : "*" : files-only full-path ] ; + InstallFile share/awish/asm/defs : [ Glob $(TOP)/asm/defs : "*" : files-only full-path ] ; + InstallFile share/awish/asm/game : [ Glob $(TOP)/asm/game : "*" : files-only full-path ] ; + InstallFile share/awish/asm/game/use : [ Glob $(TOP)/asm/game/use : "*" : files-only full-path ] ; + InstallFile share/awish/asm/goobers : [ Glob $(TOP)/asm/goobers : "*" : files-only full-path ] ; + InstallFile share/awish/asm/imports : [ Glob $(TOP)/asm/imports : "*" : files-only full-path ] ; + InstallFile share/awish/asm/items : [ Glob $(TOP)/asm/items : "*" : files-only full-path ] ; + InstallFile share/awish/asm/loaders : [ Glob $(TOP)/asm/loaders : "*" : files-only full-path ] ; + InstallFile share/awish/asm/macs : [ Glob $(TOP)/asm/macs : "*" : files-only full-path ] ; + InstallFile share/awish/asm/mapscripts : [ Glob $(TOP)/asm/mapscripts : "*" : files-only full-path ] ; +} -- 2.11.4.GIT