Commit a4e1d715 authored by Nick Connolly's avatar Nick Connolly Committed by Tomasz Zawadzki
Browse files

mk: support file extension for executables



Some platforms require that a specific file extension is used for
executables. Append $(EXEEXT) to $(APP) definitions to accommodate
this. The name EXEEXT has been chosen for consistency with automake
which uses the same variable for the same purpose.

Add extensions for generated files used by Windows to the 'clean' target
(.obj, .lib, .pdb) and add output files to .gitignore.

Tested using a cross compiler that forces a .exe suffix and verifying
that all LINK messages include the correct suffix and that a second
call to make does nothing (showing that the targets match the
generated executables).

Signed-off-by: default avatarNick Connolly <nick.connolly@mayadata.io>
Change-Id: Ief012f6294d2f94b23c8b4f9747e21a0dfb91e96
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6494


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 9854c138
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,12 +2,17 @@
*.a
*.cmd
*.d
*.dll
*.exe
*.gcda
*.gcno
*.kdev4
*.ko
*.lib
*.log
*.o
*.obj
*.pdb
*.pyc
*.so
*.so.*
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR)))
endif
endif

APP := $(APP)$(EXEEXT)

LIBS += $(SPDK_LIB_LINKER_ARGS)

CLEAN_FILES = $(APP)
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR)))
endif
endif

APP := $(APP)$(EXEEXT)

LIBS += $(SPDK_LIB_LINKER_ARGS)

CLEAN_FILES = $(APP)
+2 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ endif
S ?= $(notdir $(CURDIR))

DESTDIR?=
EXEEXT?=

ifneq ($(prefix),)
CONFIG_PREFIX=$(prefix)
@@ -354,7 +355,7 @@ LIB_C=\

# Clean up generated files listed as arguments plus a default list
CLEAN_C=\
	$(Q)rm -f *.a *.o *.d *.d.tmp *.gcno *.gcda
	$(Q)rm -f *.a *.lib *.o *.obj *.d *.d.tmp *.pdb *.gcno *.gcda

# Install a library
INSTALL_LIB=\
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ SPDK_LIB_LIST += thread util log

LIBS += -lcunit $(SPDK_STATIC_LIB_LINKER_ARGS)

APP = $(TEST_FILE:.c=)
APP = $(TEST_FILE:.c=)$(EXEEXT)

ifneq ($(UNIT_TEST_LINK_ENV),1)
ENV_LINKER_ARGS =