Commit dba48294 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

build: factor out common compile and link commands



Add common $(COMPILE_C), $(LINK_C), and $(LIB_C) variables that contain
the commands to build a .o from a .c, an app from objects and libraries,
and a library from objects, respectively.

Change-Id: Ie2eaa13156b8bf3db7a4ffa66161382d829aef07
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 22eced89
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -53,8 +53,7 @@ all : $(APP)
objs : $(OBJS)

$(APP) : $(OBJS) $(SPDK_LIBS)
	@echo "  LINK $@"
	$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
	$(LINK_C)

clean :
	$(Q)rm -f $(OBJS) *.d $(APP)
+1 −2
Original line number Diff line number Diff line
@@ -58,8 +58,7 @@ all : $(APP)
objs : $(OBJS)

$(APP) : $(OBJS) $(SPDK_LIBS)
	@echo "  LINK $@"
	$(Q)$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
	$(LINK_C)

clean :
	$(Q)rm -f $(OBJS) *.d $(APP)
+1 −1
Original line number Diff line number Diff line
@@ -52,6 +52,6 @@ clean :
	$(Q)rm -f $(LIB) $(OBJS) *.d

$(LIB) : $(OBJS)
	$(Q)ar crDs $(LIB) $(OBJS)
	$(LIB_C)

include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk
+1 −1
Original line number Diff line number Diff line
@@ -50,6 +50,6 @@ clean :
	$(Q)rm -f libspdk_nvme.a $(OBJS) *.d

libspdk_nvme.a : $(OBJS)
	$(Q)ar crDs libspdk_nvme.a $(OBJS)
	$(LIB_C)

include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk
+1 −1
Original line number Diff line number Diff line
@@ -50,6 +50,6 @@ clean :
	$(Q)rm -f libspdk_util.a $(OBJS) *.d

libspdk_util.a : $(OBJS)
	$(Q)ar crDs libspdk_util.a $(OBJS)
	$(LIB_C)

include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk
Loading