summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>2012-07-25 22:08:23 +0200
committerHarald Hoyer <harald@redhat.com>2012-07-26 08:35:02 +0200
commitab8bfca7949cf18837ead4b3aebd5f2186a6f739 (patch)
tree6f8b558e9494d53c72e9d0a309794745e5a3a353 /Makefile
parent386579a45a69c428cddffe30c473dd21213f3ea1 (diff)
downloaddracut-ab8bfca7949cf18837ead4b3aebd5f2186a6f739.tar.gz
dracut-ab8bfca7949cf18837ead4b3aebd5f2186a6f739.tar.bz2
dracut-ab8bfca7949cf18837ead4b3aebd5f2186a6f739.zip
Makefile: use implicit rules for install/dracut-install
Don't fail on install rule if install/dracut-install is not build - just skip it. $(strip) is not used by install rule, because it is nowhere set.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 14 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index a109ef0e..d013cbc6 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,8 @@ pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
-CFLAGS ?= -std=gnu99 -O2 -g -Wall
+CFLAGS ?= -O2 -g -Wall
+CFLAGS += -std=gnu99
man1pages = lsinitrd.1
@@ -32,22 +33,17 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
-all: syncheck dracut-version.sh dracut-install
+DRACUT_INSTALL_BIN = install/dracut-install
-DRACUT_INSTALL_SOURCE = \
- install/dracut-install.c \
- install/hashmap.c\
- install/log.c \
- install/util.c
+DRACUT_INSTALL_OBJECTS = \
+ install/dracut-install.o \
+ install/hashmap.o\
+ install/log.o \
+ install/util.o
-DRACUT_INSTALL_HEADER = \
- install/hashmap.h \
- install/log.h \
- install/macro.h \
- install/util.h
+all: syncheck dracut-version.sh $(DRACUT_INSTALL_BIN)
-dracut-install: $(DRACUT_INSTALL_SOURCE) $(DRACUT_INSTALL_HEADER)
- gcc $(CFLAGS) -o dracut-install $(DRACUT_INSTALL_SOURCE)
+$(DRACUT_INSTALL_BIN): $(DRACUT_INSTALL_OBJECTS)
indent:
indent -i8 -nut -br -linux -l120 install/dracut-install.c
@@ -99,7 +95,9 @@ install: doc dracut-version.sh
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
fi
- install $(strip) -m 0755 dracut-install $(DESTDIR)$(pkglibdir)/dracut-install
+ if [ -x $(DRACUT_INSTALL_BIN) ]; then \
+ install -m 0755 $(DRACUT_INSTALL_BIN) $(DESTDIR)$(pkglibdir)/dracut-install; \
+ fi
dracut-version.sh:
@echo "DRACUT_VERSION=$(VERSION)-$(GITVERSION)" > dracut-version.sh
@@ -110,7 +108,7 @@ clean:
$(RM) */*/*~
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2
- $(RM) dracut-install
+ $(RM) $(DRACUT_INSTALL_BIN) $(DRACUT_INSTALL_OBJECTS)
$(RM) $(manpages) dracut.html
$(MAKE) -C test clean