[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] dlm/test Makefile cleanup



Hi David,

any objections to this cleanup?

It's very simple and just put inline the makefile with all the others.

note that we don't build tests by default or ship them. This is not changed.

Fabio

-- 
I'm going to make him an offer he can't refuse.
diff -Naurd redhat-cluster-suite-2.20070823/dlm/tests/Makefile cluster/dlm/tests/Makefile
--- redhat-cluster-suite-2.20070823/dlm/tests/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ cluster/dlm/tests/Makefile	2007-08-24 13:54:38.000000000 +0200
@@ -0,0 +1,19 @@
+###############################################################################
+###############################################################################
+##
+##  Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
+##
+##  This copyrighted material is made available to anyone wishing to use,
+##  modify, copy, or redistribute it subject to the terms and conditions
+##  of the GNU General Public License v.2.
+##
+###############################################################################
+###############################################################################
+
+SUBDIRS=usertest
+
+%:
+	set -e && \
+	for i in ${SUBDIRS}; do \
+		${MAKE} -C $$i $@; \
+	done
diff -Naurd redhat-cluster-suite-2.20070823/dlm/tests/usertest/Makefile cluster/dlm/tests/usertest/Makefile
--- redhat-cluster-suite-2.20070823/dlm/tests/usertest/Makefile	2007-02-01 12:11:51.000000000 +0100
+++ cluster/dlm/tests/usertest/Makefile	2007-08-24 14:00:23.000000000 +0200
@@ -9,52 +9,28 @@
 ##
 ###############################################################################
 ###############################################################################
-top_srcdir = ../../..
-UNINSTALL=${top_srcdir}/scripts/uninstall.pl
-
-BINARIES=dlmtest asttest lstest pingtest lvb dlmtest2 flood alternate-lvb joinleave threads
-
-all: $(BINARIES)
-
-CFLAGS+=-I${top_srcdir}/dlm/lib -L${top_srcdir}/dlm/lib -g -D_REENTRANT
-
-ifneq (${KERNEL_SRC}, )
-CFLAGS += -I${KERNEL_SRC}/include/cluster
-else
-CFLAGS += -I/usr/include/linux/cluster
-endif
-CFLAGS += -I${top_srcdir}/lib/dlm
 
+include ../../../make/defines.mk
 
-dlmtest: dlmtest.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
-
-dlmtest2: dlmtest2.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
-
-alternate-lvb: alternate-lvb.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
 
-joinleave: joinleave.c
-	$(CC) $(CFLAGS) -Wall -o $@ $< -ldlm -lpthread
+TARGETS= dlmtest asttest lstest pingtest lvb dlmtest2 flood alternate-lvb joinleave threads
 
-flood: flood.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+all: depends ${TARGETS}
 
-asttest: asttest.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+CFLAGS += -D_REENTRANT
+CFLAGS += -Wall -g
+CFLAGS += -I${dlmincdir}
 
-lstest: lstest.c
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+LDFLAGS += -L${dlmlibdir} -ldlm -lpthread
 
-pingtest: pingtest.c	
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+depends:
+	$(MAKE) -C ../../lib all
 
-lvb: lvb.c	
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
 
-threads: threads.c	
-	$(CC) $(CFLAGS) -o $@ $< -ldlm -lpthread
+%: %.o
+	$(CC) -o $@ $^ $(LDFLAGS)
 
 clean:
-	rm -f *.o $(BINARIES) *~ core
+	rm -f *.o ${TARGETS} *~ core

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]