Fix the creation of the dumpdir directory in stress_floppy Makefile
[ltp-debian.git] / include / mk / lib.mk
blob485972406bcc18067c97987e012724b3a176d33a
2 # library include Makefile.
4 # Copyright (C) 2009, Cisco Systems Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 # Garrett Cooper, July 2009
23 # Makefile to include for libraries.
25 include $(top_srcdir)/include/mk/env_pre.mk
27 INSTALL_DIR := $(libdir)
29 # An extension of generic_leaf_target, strictly for libraries.
30 .PHONY: install_headers
32 ifndef LIB
33 $(error You must define LIB when including this Makefile)
34 endif
36 install_headers: $(addprefix $(DESTDIR)/$(includedir)/,$(notdir $(HEADER_FILES)))
38 INSTALL_MODE ?= 00664
40 MAKE_TARGETS := $(LIB)
42 LIBSRCS ?= $(wildcard $(abs_srcdir)/*.c)
43 LIBSRCS := $(subst $(abs_srcdir)/,,$(wildcard $(abspath $(LIBSRCS))))
45 LIBOBJS := $(LIBSRCS:.c=.o)
47 $(LIB): $(notdir $(LIBOBJS))
48 if [ -z "$(strip $^)" ] ; then \
49 echo "Cowardly refusing to create empty archive"; \
50 exit 1; \
52 $(if $(AR),$(AR),ar) -rc "$@" $^
53 $(if $(RANLIB),$(RANLIB),ranlib) "$@"
55 include $(top_srcdir)/include/mk/generic_leaf_target.mk