[PATCH 3/4] Makefile: rename debug/sparse as sparse-dbg during

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

 



debug/sparse have conflict with release version of sparse
on install target.

Rename debug/sparse as sparse-dbg during install.

Signed-off-by: Christopher Li <sparse@xxxxxxxxxxx>
---
 Makefile | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 4c89e4c..9db6b15 100644
--- a/Makefile
+++ b/Makefile
@@ -155,10 +155,16 @@ QUIET_INST_SH = $(Q:@=echo -n  '     INSTALL  ';)
 QUIET_INST    = $(Q:@=@echo -n '     INSTALL  ';)

 define INSTALL_EXEC
- $(QUIET_INST)install -v $1 $(DESTDIR)$2/$1 || exit 1;
+ $(QUIET_INST)install -v $1 $(DESTDIR)$2/$(notdir $1) || exit 1;

 endef

+define INSTALL_DBG
+ $(QUIET_INST)install -v debug/$1 $(DESTDIR)$2/$(notdir $1)-dbg || exit 1;
+
+endef
+
+
 define INSTALL_FILE
  $(QUIET_INST)install -v -m 644 $1 $(DESTDIR)$2/$1 || exit 1;

@@ -180,10 +186,12 @@ DBG_LIBS := $(DBG_LIB_FILE)
 REL_OBJS :=  $(LIB_OBJS) $(foreach @F,$(PROGRAMS),$(@F).o $(EXTRA_OBJS))
 DBG_OBJS :=  $(DBG_LIB_OBJS) $(foreach @F,$(PROGRAMS),debug/$(@F).o
$(EXTRA_OBJS))
 ALL_OBJS := $(REL_OBJS) $(DBG_OBJS)
-INST_PROGRAMS += $(PROGRAMS) $(DBG_PROGRAMS)
+ALL_PROGRAMS := $(REL_PROGRAMS) $(DBG_PROGRAMS)

+INST_PROGRAMS += $(REL_PROGRAMS) \
+ $(filter-out $(addprefix debug/,$(REL_PROGRAMS)),$(DBG_PROGRAMS))

-all: $(REL_PROGRAMS) $(DBG_PROGRAMS) sparse.pc
+all: $(ALL_PROGRAMS) sparse.pc

 all-installable: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc

@@ -194,6 +202,7 @@ install: all-installable
  $(Q)install -d $(DESTDIR)$(INCLUDEDIR)/sparse
  $(Q)install -d $(DESTDIR)$(PKGCONFIGDIR)
  $(foreach f,$(INST_PROGRAMS),$(call INSTALL_EXEC,$f,$(BINDIR)))
+ $(foreach f,$(REL_PROGRAMS),$(call INSTALL_DBG,$f,$(BINDIR)))
  $(foreach f,$(INST_MAN1),$(call INSTALL_FILE,$f,$(MAN1DIR)))
  $(foreach f,$(LIBS),$(call INSTALL_FILE,$f,$(LIBDIR)))
  $(foreach f,$(LIB_H),$(call INSTALL_FILE,$f,$(INCLUDEDIR)/sparse))
-- 
2.13.4
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux