mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-11-09 15:02:20 +05:30
Makefile: generate executable file name alternatively
This commit is contained in:
parent
d7e5e12126
commit
d404c4ff3a
13
Makefile
13
Makefile
@ -17,18 +17,15 @@ SRC = $(wildcard $(SRCDIR)/*.c)
|
||||
OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
|
||||
DEP = $(OBJ:.o=.d)
|
||||
|
||||
PROGNAME_RELEASE = polonium
|
||||
PROGNAME_DEBUG = polonium_debug
|
||||
PROGNAME_BASE = polonium
|
||||
PROGNAME_SUFFIX_DEBUG = debug
|
||||
|
||||
EXECUTABLE = $(PROGNAME_BASE)
|
||||
ifeq ($(DEBUG), 1)
|
||||
EXECUTABLE = $(PROGNAME_DEBUG)
|
||||
else
|
||||
EXECUTABLE = $(PROGNAME_RELEASE)
|
||||
EXECUTABLE := $(EXECUTABLE)_$(PROGNAME_SUFFIX_DEBUG)
|
||||
endif
|
||||
|
||||
EXECPATH = $(BINDIR)/$(EXECUTABLE)
|
||||
EXECPATH_RELEASE = $(BINDIR)/$(PROGNAME_RELEASE)
|
||||
EXECPATH_DEBUG = $(BINDIR)/$(PROGNAME_DEBUG)
|
||||
|
||||
all: $(EXECPATH)
|
||||
|
||||
@ -64,7 +61,7 @@ define rmdir_if_empty
|
||||
endef
|
||||
|
||||
clean:
|
||||
$(call rmfiles_if_exist,$(EXECPATH_RELEASE) $(EXECPATH_DEBUG) $(DEP) $(OBJ))
|
||||
$(call rmfiles_if_exist,$(EXECPATH) $(DEP) $(OBJ))
|
||||
$(call rmdir_if_empty,$(BINDIR))
|
||||
$(call rmdir_if_empty,$(OBJDIR))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user