rakefiles: call package's `make installProg installAux`
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 17 Jun 2019 21:01:14 +0000
changeset 264 e7a4c71cd36a
parent 263 dd183640f63e
child 265 92e3731a1532
rakefiles: call package's `make installProg installAux` ...when "installing" installing a package. This allows individual packages to define additional files to install. Usefull to install bundled libraries and/or other resources in toy archive without having to hack rakefiles itself.
makelib/rules-w.make
rakelib/dist-jv.rake
--- a/makelib/rules-w.make	Wed Jun 12 07:50:32 2019 +0000
+++ b/makelib/rules-w.make	Mon Jun 17 21:01:14 2019 +0000
@@ -642,3 +642,16 @@
 
 buildDate.h: $(GENDATE_UTILITY)
 	call $(GENDATE_UTILITY)
+
+# Following targets to be exended in bc.mak if needed.
+# The -echo command is stupid indeed, but without it
+# this stupid Borland make fails with
+#
+#   Fatal: 'installProgs' does not exist - don't know how to make it
+#
+# Sigh, this is such a burden!
+installProgs:
+	-echo "Installing programs..."
+
+installAux::
+	-echo "Installing auxiliary files..."
--- a/rakelib/dist-jv.rake	Wed Jun 12 07:50:32 2019 +0000
+++ b/rakelib/dist-jv.rake	Mon Jun 17 21:01:14 2019 +0000
@@ -160,13 +160,33 @@
           end
         end
       end
-      #Put SVN identification...
+
+      # Put SVN identification...
       if File.exist? BUILD_DIR / pkg.directory / '.svn'
         chdir BUILD_DIR / pkg.directory do
           sh "svn info > \"#{pkg_dir / pkg.directory / '.svn.info'}\""
         end
       end
 
+      # Call `make installProgs` and `make installAux`. This allows package
+      # makefiles to install additional files
+      unless pkg.application?
+        if File.exist? BUILD_DIR / pkg.directory / 'Makefile.init' then
+          if unix?
+            if not File.exists? BUILD_DIR / pkg.directory / 'makefile'
+              chdir BUILD_DIR / pkg.directory do
+                raise Exception.new("Cannot run stmkmf for #{pkg.directory}") unless sh "#{pkg.top / 'stx' / 'rules' / 'stmkmf'}"
+              end
+            end
+          end
+          chdir BUILD_DIR / pkg.directory do
+            d = win32? ? '-D' : ''
+            q = win32? ? '"' : "'"
+            make "#{q}#{d}INSTALLBASE=#{install_dir / 'lib' / 'smalltalkx' / version}#{q} installProgs installAux"
+          end
+        end
+      end
+
       if unix?
         (pkg_dir / pkg.directory / '**').each do |file|
           chmod 0644, file if File.file? file