Commit 4a1208ed authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: add handling of exe file extensions in wmake/src/Makefile (#1238)

- change internal naming from 'EXE_EXT' to 'EXT_EXE' for symmetry with
  'EXT_SO'
parent ffcff46f
......@@ -74,7 +74,7 @@ LIB_LIBS =
EXT_SO = .so
# Executable extension (with '.' separator)
EXE_EXT =
EXT_EXE =
# Library (default which is to be overridden)
LIB = libNULL
......@@ -86,7 +86,7 @@ EXE = $(WM_PROJECT).out
SEXE = a.out
#DEBUG $(info "EXE_SO = ${EXE_SO}")
#DEBUG $(info "EXE_EXT = ${EXE_EXT}")
#DEBUG $(info "EXT_EXE = ${EXT_EXE}")
#------------------------------------------------------------------------------
......@@ -129,28 +129,28 @@ LIB_HEADER_DIRS = \
#------------------------------------------------------------------------------
.PHONY: all
all: $(EXE)$(EXE_EXT)
all: $(EXE)$(EXT_EXE)
@:
.PHONY: silent
silent:
@:
$(EXE)$(EXE_EXT): $(OBJECTS)
$(EXE)$(EXT_EXE): $(OBJECTS)
@$(WM_SCRIPTS)/makeTargetDir $(EXE)
$(call QUIET_MESSAGE,ld,$(EXE)$(EXE_EXT))
$(call QUIET_MESSAGE,ld,$(EXE)$(EXT_EXE))
$E $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \
$(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) \
$(LINK_LIBS) $(GLIBS) -o $(EXE)$(EXE_EXT)
$(LINK_LIBS) $(GLIBS) -o $(EXE)$(EXT_EXE)
.PHONY: exe
exe: $(SEXE)$(EXE_EXT) | silent
exe: $(SEXE)$(EXT_EXE) | silent
$(SEXE)$(EXE_EXT): $(OBJECTS)
$(SEXE)$(EXT_EXE): $(OBJECTS)
@$(WM_SCRIPTS)/makeTargetDir $(SEXE)
$(call QUIET_MESSAGE,ld,$(SEXE)$(EXE_EXT))
$(call QUIET_MESSAGE,ld,$(SEXE)$(EXT_EXE))
$E $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
$(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)$(EXE_EXT)
$(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)$(EXT_EXE)
#------------------------------------------------------------------------------
......
......@@ -61,7 +61,10 @@ include $(GENERAL_RULES)/general
.PHONY: all clean
all: $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep $(WMAKE_BIN)/wmkdepend
all: \
$(WMAKE_BIN)/dirToString$(EXT_EXE) \
$(WMAKE_BIN)/wmkdep$(EXT_EXE) \
$(WMAKE_BIN)/wmkdepend$(EXT_EXE)
@echo "built wmake-bin for $(WM_ARCH)$(WM_COMPILER)"
clean:
......@@ -69,23 +72,23 @@ clean:
@rm -rf $(WMAKE_BIN) 2>/dev/null
@rmdir $(shell dirname $(WMAKE_BIN)) 2>/dev/null || true
$(WMAKE_BIN)/dirToString: dirToString.c
$(WMAKE_BIN)/dirToString$(EXT_EXE): dirToString.c
@mkdir -p $(WMAKE_BIN)
$(call QUIET_MESSAGE,compile,$(<F))
$E $(cc) $(cFLAGS) $(<F) -o $@
$(WMAKE_BIN)/wmkdep: wmkdep.l
$(WMAKE_BIN)/wmkdep$(EXT_EXE): wmkdep.l
@mkdir -p $(WMAKE_BIN)
$(call QUIET_MESSAGE,flex,$(<F))
$E flex -o $@.c $(<F) && $(cc) $(cFLAGS) $@.c -o $@
@rm -f $@.c 2>/dev/null
$(WMAKE_BIN)/wmkdepend: wmkdepend.cpp
$(WMAKE_BIN)/wmkdepend$(EXT_EXE): wmkdepend.cpp
@mkdir -p $(WMAKE_BIN)
$(call QUIET_MESSAGE,wmkdepend,$(<F))
$E $(CC) $(c++FLAGS) $(c++LESSWARN) $(<F) -o $@
# $(WMAKE_BIN)/wmkdepend: wmkdepend.rl
# $(WMAKE_BIN)/wmkdepend$(EXT_EXE): wmkdepend.rl
# @mkdir -p $(WMAKE_BIN)
# $(call QUIET_MESSAGE,ragel,$(<F))
# $E ragel -G2 -o $@.cpp $(<F) && $(CC) $(c++FLAGS) $(c++LESSWARN) $@.cpp -o $@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment