Browse Source

GNU make with other make trick!

Douglas William Thrift 9 years ago
parent
commit
24347e8859
5 changed files with 43 additions and 6 deletions
  1. 1 0
      .gitignore
  2. 1 1
      GNUmakefile.in
  3. 11 3
      configure
  4. 3 2
      configure.ac
  5. 27 0
      makefile.in

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@ autom4te.cache
 config.log
 config.status
 dtpstree
+makefile

+ 1 - 1
GNUmakefile.in

@@ -96,4 +96,4 @@ clean:
 	rm -fv dtpstree $(wildcard *core)
 
 distclean: clean
-	rm -fv GNUmakefile Makefile config.log config.status
+	rm -fv GNUmakefile config.log config.status makefile

+ 11 - 3
configure

@@ -612,7 +612,7 @@ HELP2MAN
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
-GMAKE
+GNUMAKE
 ifGNUmake
 target_alias
 host_alias
@@ -2207,9 +2207,9 @@ $as_echo "\"Not found\"" >&6; };
         fi
 
 
-GMAKE=$_cv_gnu_make_command
+GNUMAKE=$_cv_gnu_make_command
 
-if test "x$GMAKE" = x; then :
+if test "x$GNUMAKE" = x; then :
   as_fn_error "You need GNU make" "$LINENO" 5
 fi
 # Find a good install program.  We prefer a C program (faster),
@@ -4520,6 +4520,13 @@ case $ac_cv_have_decl_KERN_PROC_PROC$ac_cv_have_decl_KERN_PROC_ALL in #(
     as_fn_error "You need libkvm" "$LINENO" 5
  ;;
 esac
+case $GNUMAKE in #(
+  make) :
+     ;; #(
+  *) :
+    ac_config_files="$ac_config_files makefile"
+ ;;
+esac
 ac_config_files="$ac_config_files GNUmakefile"
 
 cat >confcache <<\_ACEOF
@@ -5222,6 +5229,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
+    "makefile") CONFIG_FILES="$CONFIG_FILES makefile" ;;
     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
 
   *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

+ 3 - 2
configure.ac

@@ -23,8 +23,8 @@ AC_INIT([DT PS Tree], [1.0.2], [douglas@douglasthrift.net], [dtpstree], [http://
 AC_CONFIG_SRCDIR([dtpstree.cpp])
 AC_CONFIG_AUX_DIR([build-aux])
 CHECK_GNU_MAKE
-AC_SUBST([GMAKE], [$_cv_gnu_make_command])
-AS_IF([test "x$GMAKE" = x], [AC_MSG_ERROR([You need GNU make])])
+AC_SUBST([GNUMAKE], [$_cv_gnu_make_command])
+AS_IF([test "x$GNUMAKE" = x], [AC_MSG_ERROR([You need GNU make])])
 AC_PROG_INSTALL
 AC_PATH_PROG([HELP2MAN], [help2man], [:])
 AC_MSG_CHECKING([for realpath])
@@ -119,5 +119,6 @@ AC_CHECK_DECLS([KERN_PROC_PROC, KERN_PROC_ALL], [], [], [DT_INCLUDES_KVM])
 AS_CASE([$ac_cv_have_decl_KERN_PROC_PROC$ac_cv_have_decl_KERN_PROC_ALL],
 	[*yes*], [], [DT_MSG_KVM]
 )
+AS_CASE([$GNUMAKE], [make], [], [AC_CONFIG_FILES([makefile])])
 AC_CONFIG_FILES([GNUmakefile])
 AC_OUTPUT

+ 27 - 0
makefile.in

@@ -0,0 +1,27 @@
+# DT PS Tree
+#
+# Douglas Thrift
+#
+# @configure_input@
+
+#  Copyright 2010 Douglas Thrift
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+GNUMAKE := @GNUMAKE@
+
+all:
+	$(GNUMAKE) $@
+
+.DEFAULT:
+	$(GNUMAKE) $@