[lockdev-devel] [PATCH 17/19] remove custom Makefile

Ludwig Nussel ludwig.nussel at suse.de
Thu Feb 25 10:02:14 UTC 2010


---
 Makefile |  108 --------------------------------------------------------------
 Rules.mk |   51 -----------------------------
 2 files changed, 0 insertions(+), 159 deletions(-)
 delete mode 100644 Makefile
 delete mode 100644 Rules.mk

diff --git a/Makefile b/Makefile
deleted file mode 100644
index a48073a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
--include Rules.mk
-
-libname	= liblockdev
-pkgname = lockdev
-
-objs	= src/lockdev.o
-
-lockdev	= src/sample.c
-
-VER	= 1.0.3
-MVER	= 1
-
-static	= ${libname}.a
-shared	= ${libname}.so.${VER}
-soname	= ${libname}.so.${MVER}
-
-# overwritten by caller (e.g.: debian/rules)
-prefix	= /usr/local
-srcdir=.
-
-sbindir	= ${DESTDIR}${prefix}/sbin
-libdir	= ${DESTDIR}${prefix}/lib
-incdir	= ${DESTDIR}${prefix}/include
-mandir	= ${DESTDIR}${prefix}/share/man
-
-CC	= gcc
-CFLAGS	= -g -O2 -Wall -pipe -fPIC 
-LCFLAGS	= ${CFLAGS} -D_REENTRANT
-LDLIBS	= -llockdev
-CPPFLAGS = -I$(srcdir)/src
-ifneq (${DEBUG},)
-CPPFLAGS += -DDEBUG=${DEBUG}
-endif
-
-.PHONY: shared static perl-lib
-ALL:	shared static lockdev perl-lib
-
-static ${static}:       ${objs}
-	$(AR) $(ARFLAGS) ${static} $^
-
-shared ${shared}:	${objs}
-	${CC} ${LCFLAGS} -shared -Wl,-soname,${soname} $^ -lc -o ${shared}
-
-lockdev.o: ${lockdev}
-	${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $^
-
-lockdev: lockdev.o ${static}
-	${CC} -o $@ $^
-
-perl-lib:	static
-	cd LockDev && perl Makefile.PL INSTALLDIRS=vendor
-	cd LockDev && make OPTIMIZE="-O2 -g -Wall"
-	cd LockDev && make test
-
-.PHONY: install install_dev install_dbg install_doc install_run 
-install:	install_dev install_dbg install_doc install_run
-
-install_dev:	${static} src/lockdev.h
-	install -m755 -d	${libdir}
-	install -m644 ${static}	${libdir}
-	install -m755 -d	${incdir}
-	install -m644 src/lockdev.h	${incdir}
-	install -m644 src/ttylock.h	${incdir}
-	install -m644 src/baudboy.h	${incdir}
-
-install_debug:	${static} ${shared}
-	install -m755 -d	${libdir}/debug
-	install -m644 ${static}	${libdir}/debug
-	install -m644 ${shared}	${libdir}/debug/${soname}
-
-install_profile:	${static} ${shared}
-	install -m755 -d	${libdir}/profile
-	install -m644 ${static}	${libdir}/profile
-	install -m644 ${shared}	${libdir}/profile/${soname}
-
-install_doc:	docs/lockdev.3
-	install -m755 -d	${mandir}/man3
-	install -m755 -d	${mandir}/man8
-	install -m644 docs/lockdev.3	${mandir}/man3
-	install -m644 docs/lockdev.8	${mandir}/man8
-
-install_run:	${shared}
-	install -m755 -d	${libdir}
-	install -m755 ${shared}	${libdir}
-	ln -fs ${shared}		${libdir}/liblockdev.so
-	install -m755 -d	${sbindir}
-	install -m755 lockdev	${sbindir}
-
-.PHONY: clean distclean perl-clean mostyclean 
-perl-clean:	clean
-	cd LockDev && rm -rf *~ *.o LockDev.bs LockDev.c \
-		Makefile Makefile.old blib pm_to_blib 
-
-clean:
-	-find . -name '*~' | xargs --no-run-if-empty  rm -f 
-	-find . -name '*.o' | xargs --no-run-if-empty  rm -f 
-	-find . -name '*.z' | xargs --no-run-if-empty  rm -f 
-
-mostyclean:	clean
-	-rm -f *.a *.so *.so.*
-	-rm -f shared static debug profile _SRCDIR_
-
-distclean:	mostyclean perl-clean
-
-.PHONY: distribute dist tarball
-dist distribute:	tarball
-tarball: distclean
-	cd .. 	&& tar -cvf - ${pkgname}-${VER} | gzip -9c > ${pkgname}_${VER}.tgz
diff --git a/Rules.mk b/Rules.mk
deleted file mode 100644
index 4aa5362..0000000
--- a/Rules.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-### this fragment of makefile _must_ be included in the makefile
-### and this variable ( create_debug_lib ) must be passed to the 
-### sub-make to activate this rule. Do this in the debug building 
-
-ifdef create_debug_lib
-
-_SRCDIR_:
-	ln -sf . $@
-
-### How does this work?
-### a little explanation:
-### the build stage (and all the binary) depends from a file not phony
-### named _SRCDIR_ which is created in the current working dir as a 
-### symlink to . (dot, the current dir), and removed in the clean stage.
-### We overwrite the implicit rule to make objects from .c sources,
-### producing the asm source file from the .c source seen through the
-### _SRCDIR_ symlink. In the rule we change that strange name with the
-### absolute pathname where we will store the sources, so that the
-### object (and the libraries) will record that name instead that the 
-### actual one.
-### The purpose is to have a default link from the libraries to the
-### place where the debugging binary package will put the sources, so that
-### gdb will diplay source lines without _any_ need of strange declarations.
-
-define compile.c
-	${COMPILE.c} -S _SRCDIR_/$< -o $*.ss
-endef
-define compile.cc
-	${COMPILE.cc} -S _SRCDIR_/$< -o $*.ss
-endef
-define the_rest
-	sed 's,^.stabs \"_SRCDIR_\/,.stabs \"${abs_src}/,' $*.ss > $*.s
-	${COMPILE.s} -o $@ $*.s
-	${RM} $*.ss $*.s
-endef
-
-# overwriting implicit rule 
-%.o: %.c _SRCDIR_
-	@echo "=== overwritten rule .o:.c ($@: $^) ==="
-	${compile.c}
-	${the_rest}
-
-# overwriting implicit rule 
-%.o: %.cc _SRCDIR_
-	@echo "=== overwritten rule .o:.cc ($@: $^) ==="
-	${compile.cc}
-	${the_rest}
-
-endif # create_debug_lib
-
-###############################################################################
-- 
1.6.4.2




More information about the lockdev-devel mailing list