mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
make: use .exe only on Windows
This commit is contained in:
parent
ef0018d6bc
commit
869677a56a
1 changed files with 21 additions and 20 deletions
41
GNUmakefile
41
GNUmakefile
|
@ -25,7 +25,7 @@ _SYS := $(patsubst MINGW%,MinGW,$(_SYS))
|
||||||
|
|
||||||
ifneq ($(filter $(_SYS),MSYS MinGW),)
|
ifneq ($(filter $(_SYS),MSYS MinGW),)
|
||||||
WIN32 := 1
|
WIN32 := 1
|
||||||
VEXE := ./v.exe
|
EXE_EXT := .exe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(_SYS),Linux)
|
ifeq ($(_SYS),Linux)
|
||||||
|
@ -98,11 +98,11 @@ endif
|
||||||
|
|
||||||
all: latest_vc latest_tcc latest_legacy
|
all: latest_vc latest_tcc latest_legacy
|
||||||
ifdef WIN32
|
ifdef WIN32
|
||||||
$(CC) $(CFLAGS) -std=c99 -municode -w -o v1.exe $(VC)/$(VCFILE) $(LDFLAGS) -lws2_32 || cmd/tools/cc_compilation_failed_windows.sh
|
$(CC) $(CFLAGS) -std=c99 -municode -w -o v1$(EXE_EXT) $(VC)/$(VCFILE) $(LDFLAGS) -lws2_32 || cmd/tools/cc_compilation_failed_windows.sh
|
||||||
./v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
./v1$(EXE_EXT) -no-parallel -o v2$(EXE_EXT) $(VFLAGS) cmd/v
|
||||||
./v2.exe -o $(VEXE) $(VFLAGS) cmd/v
|
./v2$(EXE_EXT) -o $(VEXE)$(EXE_EXT) $(VFLAGS) cmd/v
|
||||||
$(RM) v1.exe
|
$(RM) v1$(EXE_EXT)
|
||||||
$(RM) v2.exe
|
$(RM) v2$(EXE_EXT)
|
||||||
else
|
else
|
||||||
ifdef LEGACY
|
ifdef LEGACY
|
||||||
$(MAKE) -C $(TMPLEGACY)
|
$(MAKE) -C $(TMPLEGACY)
|
||||||
|
@ -110,15 +110,15 @@ ifdef LEGACY
|
||||||
rm -rf $(TMPLEGACY)
|
rm -rf $(TMPLEGACY)
|
||||||
$(eval override LDFLAGS+=-L$(realpath $(LEGACYLIBS))/lib -lMacportsLegacySupport)
|
$(eval override LDFLAGS+=-L$(realpath $(LEGACYLIBS))/lib -lMacportsLegacySupport)
|
||||||
endif
|
endif
|
||||||
$(CC) $(CFLAGS) -std=gnu99 -w -o v1.exe $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS) || cmd/tools/cc_compilation_failed_non_windows.sh
|
$(CC) $(CFLAGS) -std=gnu99 -w -o v1$(EXE_EXT) $(VC)/$(VCFILE) -lm -lpthread $(LDFLAGS) || cmd/tools/cc_compilation_failed_non_windows.sh
|
||||||
./v1.exe -no-parallel -o v2.exe $(VFLAGS) cmd/v
|
./v1$(EXE_EXT) -no-parallel -o v2$(EXE_EXT) $(VFLAGS) cmd/v
|
||||||
./v2.exe -nocache -o $(VEXE) $(VFLAGS) cmd/v
|
./v2$(EXE_EXT) -nocache -o $(VEXE)$(EXE_EXT) $(VFLAGS) cmd/v
|
||||||
rm -rf v1.exe v2.exe
|
rm -rf v1$(EXE_EXT) v2$(EXE_EXT)
|
||||||
endif
|
endif
|
||||||
@$(VEXE) run cmd/tools/detect_tcc.v
|
@$(VEXE)$(EXE_EXT) run cmd/tools/detect_tcc.v
|
||||||
@echo "V has been successfully built"
|
@echo "V has been successfully built"
|
||||||
@$(VEXE) -version
|
@$(VEXE)$(EXE_EXT) -version
|
||||||
@$(VEXE) run .github/problem-matchers/register_all.vsh
|
@$(VEXE)$(EXE_EXT) run .github/problem-matchers/register_all.vsh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(TMPTCC)
|
rm -rf $(TMPTCC)
|
||||||
|
@ -136,7 +136,7 @@ latest_vc:
|
||||||
endif
|
endif
|
||||||
|
|
||||||
check_for_working_tcc:
|
check_for_working_tcc:
|
||||||
@$(TMPTCC)/tcc.exe --version > /dev/null 2> /dev/null || echo "The executable '$(TMPTCC)/tcc.exe' does not work."
|
@$(TMPTCC)/tcc$(EXE_EXT) --version > /dev/null 2> /dev/null || echo "The executable '$(TMPTCC)/tcc$(EXE_EXT)' does not work."
|
||||||
|
|
||||||
fresh_vc:
|
fresh_vc:
|
||||||
rm -rf $(VC)
|
rm -rf $(VC)
|
||||||
|
@ -145,7 +145,7 @@ fresh_vc:
|
||||||
ifndef local
|
ifndef local
|
||||||
latest_tcc: $(TMPTCC)/.git/config
|
latest_tcc: $(TMPTCC)/.git/config
|
||||||
cd $(TMPTCC) && $(GITCLEANPULL)
|
cd $(TMPTCC) && $(GITCLEANPULL)
|
||||||
ifneq (,$(wildcard ./tcc.exe))
|
ifneq (,$(wildcard ./tcc$(EXE_EXT)))
|
||||||
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
@$(MAKE) --quiet check_for_working_tcc 2> /dev/null
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -202,20 +202,21 @@ asan:
|
||||||
$(MAKE) all CFLAGS='-fsanitize=address,undefined'
|
$(MAKE) all CFLAGS='-fsanitize=address,undefined'
|
||||||
|
|
||||||
selfcompile:
|
selfcompile:
|
||||||
$(VEXE) -cg -o v cmd/v
|
$(VEXE)$(EXE_EXT) -cg -o v cmd/v
|
||||||
|
|
||||||
selfcompile-static:
|
selfcompile-static:
|
||||||
$(VEXE) -cg -cflags '--static' -o v-static cmd/v
|
$(VEXE)$(EXE_EXT) -cg -cflags '--static' -o v-static cmd/v
|
||||||
|
|
||||||
### NB: Please keep this Makefile and make.bat simple.
|
### NB: Please keep this Makefile and make.bat simple.
|
||||||
install:
|
install:
|
||||||
@echo 'Please use `sudo ./v symlink` instead.'
|
@echo 'Please use `sudo ./v symlink` instead.'
|
||||||
|
|
||||||
check:
|
check:
|
||||||
$(VEXE) test-all
|
$(VEXE)$(EXE_EXT) test-all
|
||||||
|
|
||||||
etags:
|
etags:
|
||||||
./v -print-v-files cmd/v | grep -v :parse_text| etags -L -
|
./v$(EXE_EXT) -print-v-files cmd/v | grep -v :parse_text| etags -L -
|
||||||
|
|
||||||
ctags:
|
ctags:
|
||||||
./v -print-v-files cmd/v | grep -v :parse_text| ctags -L -
|
./v$(EXE_EXT) -print-v-files cmd/v | grep -v :parse_text| ctags -L -
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue