* NormalLintTarget (srclist)
* LintTarget ()
* LinkSourceFile (src,dir)
+ * CopySourceFile (src,dir)
* LinkFile (tofile,fromfile)
* MakeSubincludesForBuild (step,dir,srclist)
* LangNamedTargetSubdirs (lang,name,dirs,verb,flags,subname)
* MakeLintSubdirs (dirs,target,subtarget)
* LintSubdirs (dirs)
* MakeLintLibSubdirs (dirs)
+ * MakeMakeOneSubdirs ()
* MakeMakeSubdirs (dirs,target)
* MakefileSubdirs (dirs)
* CppScriptTarget (dst,src,defs,deplist)
* CppSourceFile (dst,src,defs,deplist)
* MakeDirectories (step,dirs)
* AllTarget (depends)
+ * MakeImakeDir ()
+ * DoUDB_SCRIPT3 (target, file, script, build)
+ * DoUDB_SCRIPT4 (target, file, script, build)
*
*
* The following are in specific <os>Lib.rules:
#define NullParameter
+/* stringify macro */
+#ifndef STR
+# if defined(__llvm__)
+# define STR2(x) #x
+# else
+# define STR2(x) "x"
+# endif
+#define STR(x) STR2(x)
+#endif
+
/* if [ -d ] or [ ! -d ] causes make to fail, define this as - */
#ifndef DirFailPrefix
#define DirFailPrefix
* Concat - concatenates two strings.
*/
#ifndef Concat
-#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp)
+#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
#define Concat(a,b)a##b
#else
#define Concat(a,b)a/**/b
* Concat3 - concatenates three strings.
*/
#ifndef Concat3
-#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp)
+#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
#define Concat3(a,b,c)a##b##c
#else
#define Concat3(a,b,c)a/**/b/**/c
* Concat4 - concatenates four strings.
*/
#ifndef Concat4
-#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp)
+#if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
#define Concat4(a,b,c,d)a##b##c##d
#else
#define Concat4(a,b,c,d)a/**/b/**/c/**/d
* exists to avoid problems with some preprocessors
*/
#ifndef _XUseCat
-# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp)
+# if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
# if defined(UseInstalled) || UseInstalledX11
# define _XUseCat(a,b,c) a##c
# else
#endif
+/*
+ * CopySourceFile - snag source file from some other directory
+ */
+#ifndef CopySourceFile
+#define CopySourceFile(src,dir) @@\
+src: dir/src @@\
+ RemoveFile($@) @@\
+ $(CP) $? $@ @@\
+ @@\
+NoConfigRec(src) @@\
+ @@\
+includes:: src @@\
+ @@\
+depend:: src @@\
+ @@\
+clean:: @@\
+ RemoveFile(src)
+#endif
+
+
/*
* LinkFile - link a file
*/
#endif /* MakeLintLibSubdirs */
+/*
+ * MakeMakeOneSubdirs - generate rules to recreate $(ONESUBDIR)/Makefile
+ * as part of the specified step in the build. This separate, explicit target
+ * exists so that clearmake will know what its goal is and do wink-in.
+ */
+#ifndef MakeMakeOneSubdirs
+#define MakeMakeOneSubdirs() @@\
+$(ONESUBDIR)/Makefile: @@\
+ @MakeFlagsToShellFlags(n,executeit="no"); \ @@\
+ cd $(ONESUBDIR); \ @@\
+ if [ "$$executeit" != "no" ]; then \ @@\
+ ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\
+ fi;
+#endif /* MakeMakeOneSubdirs */
+
+
/*
* MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
* of the specified step in the build. If $(TOP) is set to an absolute path,
* do not prepend the ../ prefix. This makes running things outside of the
* source tree much easier.
- * $(ONESUBDIR)/Makefile exists as a separate, explicit target so that
- * clearmake will know what its goal is and do wink-in.
*/
#ifndef MakeMakeSubdirs
#define MakeMakeSubdirs(dirs,target) @@\
-$(ONESUBDIR)/Makefile: @@\
- @MakeFlagsToShellFlags(n,executeit="no"); \ @@\
- cd $(ONESUBDIR); \ @@\
- if [ "$$executeit" != "no" ]; then \ @@\
- ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\
- fi; @@\
- @@\
target:: @@\
-@MakeFlagsToShellFlags(ik,set +e); \ @@\
MakeFlagsToShellFlags(n,executeit="no"); \ @@\
*/
#ifndef MakefileSubdirs
#define MakefileSubdirs(dirs) @@\
+MakeMakeOneSubdirs() @@\
MakeMakeSubdirs(dirs,Makefiles)
#endif /* MakefileSubdirs */
all:: depends
#endif /* AllTarget */
+
+/*
+ * MakeImakeDir - call make in imake directory.
+ */
+#ifndef MakeImakeDir
+#define MakeImakeDir() cd $(IMAKESRC) && \ @@\
+ if [ -f Makefile ]; then \ @@\
+ $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
+ else \ @@\
+ $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
+ fi
+#endif /* MakeImakeDir */
+
+
+/*
+ * DoUDB_SCRIPT3 - macro for creation of udb scripts for installation
+ */
+#ifndef DoUDB_SCRIPT3
+#define DoUDB_SCRIPT3(target, file, script, build) @@\
+target:: $(DATABASE_DIR)/file.udb @@\
+ script -toLst -ReleaseStream $(PLATFORM) \ @@\
+ $(DATABASE_DIR)/file.udb > file.lst @@\
+ build file ../../..
+#endif
+
+
+/*
+ * DoUDB_SCRIPT4 - macro for creation of udb scripts for installation
+ */
+#ifndef DoUDB_SCRIPT4
+#define DoUDB_SCRIPT4(target, file, script, build) @@\
+target:: $(DATABASE_DIR)/file.udb @@\
+ script -toLst -ReleaseStream $(PLATFORM) \ @@\
+ $(DATABASE_DIR)/file.udb > file.lst @@\
+ build file ../../../..
+#endif
+
+
#ifdef DefineOldLibraryRules
#include <oldlib.rules>
#endif