Makefile
changeset 1423 d7b111d2d3d7
parent 1003 a4d17d6bc179
child 1463 efddc1a6c3cf
--- a/Makefile	Sun Nov 23 21:46:46 2014 -0800
+++ b/Makefile	Mon Nov 24 16:03:15 2014 -0800
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -34,8 +34,6 @@
 
 all: setup install check
 
-setup: open-src/common/Makefile.options
-
 # Choose options for branding, download sites, etc.
 # Makefile.options is created as a link to a file containing the desired
 # options, chosen by the first of these found in open-src/common:
@@ -44,6 +42,8 @@
 #	3) Makefile.options.opensolaris
 MK_OPTS = open-src/common/Makefile.options
 
+setup: $(MK_OPTS)
+
 $(MK_OPTS):
 	@ if [[ -n "${X_BUILD_OPTIONS}" ]] ; then \
 	    X_BUILD_OPTIONS="${X_BUILD_OPTIONS}" ; \
@@ -69,3 +69,30 @@
 ### Include common definitions
 DIRNAME=""
 include $(TOP)/open-src/common/Makefile.subdirs
+
+# Files & directories to include in source release zip files
+ZIP_GENERATED_FILES = BUILD_INSTRUCTIONS.txt pkglist.txt
+ZIP_CONTENTS  = $(ZIP_GENERATED_FILES)
+ZIP_CONTENTS += buildit download-tarballs make_release_packages Makefile
+ZIP_CONTENTS += open-src pkg exception_lists
+ZIP_CONTENTS += .hg .hgignore .hgtags 
+
+ZIP_COMMENT_FILE = proto/x.zipcomment
+
+# Don't include Makefile.options symlink in zipfile, so it gets correctly
+# autogenerated for the builder when they first build it
+ZIP_EXCLUDE_FILES = $(MK_OPTS)
+
+proto/x.zip: $(ZIP_GENERATED_FILES)
+	-rm -f proto/x.zip
+	( print 'Oracle Solaris X Consolidation open source release' ; \
+	  LC_ALL=en_US.UTF-8 date ; \
+	  print -n 'hg id: ' ; hg id -it ) > $(ZIP_COMMENT_FILE)
+	zip -9rqyz proto/x.zip $(ZIP_CONTENTS) -x $(ZIP_EXCLUDE_FILES) \
+	  < $(ZIP_COMMENT_FILE)
+
+BUILD_INSTRUCTIONS.txt:
+	cd open-src && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)
+
+pkglist.txt:
+	cd pkg && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)