[DRBD-cvs] r1889 - in branches/drbd-0.7: . drbd

www-data www-data at linbit.com
Mon Jul 18 14:24:13 CEST 2005


Author: lars
Date: 2005-07-18 14:24:12 +0200 (Mon, 18 Jul 2005)
New Revision: 1889

Modified:
   branches/drbd-0.7/Makefile
   branches/drbd-0.7/drbd/Makefile
Log:

get rid of one Makefile warning
generate drbd_buildtag.c unconditionally again



Modified: branches/drbd-0.7/Makefile
===================================================================
--- branches/drbd-0.7/Makefile	2005-07-18 11:51:11 UTC (rev 1888)
+++ branches/drbd-0.7/Makefile	2005-07-18 12:24:12 UTC (rev 1889)
@@ -105,21 +105,7 @@
 # update of drbd_buildtag.c is forced:
 .PHONY: drbd/drbd_buildtag.c
 drbd/drbd_buildtag.c:
-	@is_tarball=`test -e .svn/. && echo false || echo true`;		\
-	set -e; exec > $@.new;							\
-	echo -e "/* automatically generated. DO NOT EDIT. */";			\
-	echo -e "const char * drbd_buildtag(void)\n{";			\
-	if $$is_tarball; then							\
-	  if ! test -e $@ ; then 						\
-	  	echo >&2 "your DRBD source tree is broken. unpack again.";	\
-		exit 1;								\
-	  fi;									\
-	  grep return $@ ;							\
-	else									\
-	  echo -ne "\treturn \"SVN Revision: "; svnversion -n .; echo \";	\
-	fi ;									\
-	echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";	\
-       	mv $@{.new,}
+	$(MAKE) -C drbd drbd_buildtag.c
 
 # update of .filelist is forced:
 .PHONY: .filelist

Modified: branches/drbd-0.7/drbd/Makefile
===================================================================
--- branches/drbd-0.7/drbd/Makefile	2005-07-18 11:51:11 UTC (rev 1888)
+++ branches/drbd-0.7/drbd/Makefile	2005-07-18 12:24:12 UTC (rev 1889)
@@ -54,8 +54,6 @@
   CONFIG_BLK_DEV_DRBD := m
   export DRBDSRC CONFIG_BLK_DEV_DRBD
 
-  KDIR_Makefile_PATCHLEVEL = $(shell grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3)
-
   # to be overridden on command line:
   PREFIX := /
   ifeq ($(wildcard ../build-for-uml),../build-for-uml)
@@ -66,13 +64,7 @@
     KDIR := /lib/modules/$(shell uname -r)/build
   endif
 
-  # shell ls, because some of them may be missing
-  # inside a patched kernel source tree
-  SRC_FILES := $(shell ls 2>/dev/null\
-	linux/drbd_config.h linux/drbd.h drbd_actlog.c drbd_bitmap.c drbd_fs.c \
-	drbd_main.c drbd_proc.c drbd_receiver.c drbd_req.c drbd_worker.c \
-	lru_cache.c drbd_compat_types.h drbd_compat_wrappers.h drbd_int.h \
-	lru_cache.h hlist.h mempool-2.4.c mempool.h)
+  KDIR_Makefile_PATCHLEVEL = $(shell test -e $(KDIR)/Makefile && grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3)
 
   .PHONY: drbd.o default all greeting clean kbuild install dep
 
@@ -84,17 +76,31 @@
 	@echo "" ;\
 	echo "    Calling toplevel makefile of kernel source tree, which I believe is in" ;\
 	echo "    KDIR=$(KDIR)" ; \
-	echo ""
+	echo "";
+	@if ! test -e $(KDIR)/Makefile ; then \
+		echo -e "    SORRY, kernel makefile not found. You need to tell me a correct KDIR!\n" ;\
+		false;\
+	fi
 
-  drbd_buildtag.c: $(SRC_FILES)
-	@if grep ^drbd/drbd_buildtag.c: ../Makefile &>/dev/null; then \
-	  $(MAKE) -C .. drbd/drbd_buildtag.c ;\
-	 else \
-	  echo "drbd_buildtag.c outdated." ;\
-	  echo "you probably need to do a 'make' in DRBDs toplevel directory.";\
-	  false ;\
-	 fi
+.PHONY: drbd_buildtag.c
 
+  drbd_buildtag.c:
+	@is_tarball=`test -e .svn/. -a -e ../.svn/. && echo false || echo true`;\
+	set -e; exec > $@.new;							\
+	echo -e "/* automatically generated. DO NOT EDIT. */";			\
+	echo -e "const char * drbd_buildtag(void)\n{";				\
+	if $$is_tarball; then							\
+	  if ! test -e $@ ; then 						\
+	  	echo >&2 "your DRBD source tree is broken. unpack again.";	\
+		exit 1;								\
+	  fi;									\
+	  grep return $@ ;							\
+	else									\
+	  echo -ne "\treturn \"SVN Revision: "; svnversion -n ..; echo \";	\
+	fi ;									\
+	echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";	\
+       	mv $@{.new,}
+
   kbuild: drbd_buildtag.c
 	@rm -f .kernelrelease*
 	-test -f ../scripts/adjust_drbd_config_h.sh && \



More information about the drbd-cvs mailing list