makefile: abstract V exe extension for better coherence (#6544)
							parent
							
								
									de77f0ba0f
								
							
						
					
					
						commit
						a6071da33b
					
				
							
								
								
									
										26
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										26
									
								
								Makefile
								
								
								
								
							|  | @ -3,6 +3,7 @@ CFLAGS ?= | ||||||
| LDFLAGS ?= | LDFLAGS ?= | ||||||
| TMPDIR ?= /tmp | TMPDIR ?= /tmp | ||||||
| VC     ?= ./vc | VC     ?= ./vc | ||||||
|  | V      := ./v | ||||||
| 
 | 
 | ||||||
| VCFILE := v.c | VCFILE := v.c | ||||||
| TMPTCC := /var/tmp/tcc | TMPTCC := /var/tmp/tcc | ||||||
|  | @ -18,6 +19,7 @@ _SYS := $(patsubst MINGW%,MinGW,$(_SYS)) | ||||||
| 
 | 
 | ||||||
| ifneq ($(filter $(_SYS),MSYS MinGW),) | ifneq ($(filter $(_SYS),MSYS MinGW),) | ||||||
| WIN32 := 1 | WIN32 := 1 | ||||||
|  | V:=./v.exe | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| ifeq ($(_SYS),Linux) | ifeq ($(_SYS),Linux) | ||||||
|  | @ -45,22 +47,22 @@ endif | ||||||
| 
 | 
 | ||||||
| all: latest_vc latest_tcc | all: latest_vc latest_tcc | ||||||
| ifdef WIN32 | ifdef WIN32 | ||||||
| 	$(CC) $(CFLAGS) -g -std=c99 -municode -w -o v.exe $(VC)/$(VCFILE) $(LDFLAGS) | 	$(CC) $(CFLAGS) -g -std=c99 -municode -w -o $(V) $(VC)/$(VCFILE) $(LDFLAGS) | ||||||
| ifdef prod | ifdef prod | ||||||
| 	./v.exe -prod self | 	$(V) -prod self | ||||||
| else | else | ||||||
| 	./v.exe self | 	$(V) self | ||||||
| endif | endif | ||||||
| else | else | ||||||
| 	$(CC) $(CFLAGS) -g -std=gnu11 -w -o v $(VC)/$(VCFILE) $(LDFLAGS) -lm -lpthread | 	$(CC) $(CFLAGS) -g -std=gnu11 -w -o $(V) $(VC)/$(VCFILE) $(LDFLAGS) -lm -lpthread | ||||||
| ifdef ANDROID | ifdef ANDROID | ||||||
| 	chmod 755 v | 	chmod 755 v | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| ifdef prod | ifdef prod | ||||||
| 	./v -prod self | 	$(V) -prod self | ||||||
| else | else | ||||||
| 	./v self | 	$(V) self | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| ifndef ANDROID | ifndef ANDROID | ||||||
|  | @ -68,7 +70,7 @@ ifndef ANDROID | ||||||
| endif | endif | ||||||
| endif | endif | ||||||
| 	@echo "V has been successfully built" | 	@echo "V has been successfully built" | ||||||
| 	@./v -version | 	@$(V) -version | ||||||
| 
 | 
 | ||||||
| #clean: clean_tmp
 | #clean: clean_tmp
 | ||||||
| #git clean -xf
 | #git clean -xf
 | ||||||
|  | @ -115,15 +117,15 @@ $(VC)/.git/config: | ||||||
| 	$(MAKE) fresh_vc | 	$(MAKE) fresh_vc | ||||||
| 
 | 
 | ||||||
| selfcompile: | selfcompile: | ||||||
| 	./v -cg -o v cmd/v | 	$(V) -cg -o v cmd/v | ||||||
| 
 | 
 | ||||||
| selfcompile-static: | selfcompile-static: | ||||||
| 	./v -cg -cflags '--static' -o v-static cmd/v | 	$(V) -cg -cflags '--static' -o v-static cmd/v | ||||||
| 
 | 
 | ||||||
| modules: module_builtin module_strings module_strconv | modules: module_builtin module_strings module_strconv | ||||||
| module_builtin: | module_builtin: | ||||||
| 	#./v build module vlib/builtin > /dev/null | 	#$(V) build module vlib/builtin > /dev/null | ||||||
| module_strings: | module_strings: | ||||||
| 	#./v build module vlib/strings > /dev/null | 	#$(V) build module vlib/strings > /dev/null | ||||||
| module_strconv: | module_strconv: | ||||||
| 	#./v build module vlib/strconv > /dev/null | 	#$(V) build module vlib/strconv > /dev/null | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue