mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Remove .exe suffix when cross-compiling on Windows (#27448)
When compiling GItea for Linux on Windows, you get a `gitea.exe` file as output, but because it's a Linux executable, the `.exe` extension is unnecessary. This PR adds a check for `GOOS` environment variable in addition to `OS`.
This commit is contained in:
		
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -49,10 +49,14 @@ ifeq ($(HAS_GO), yes)
 | 
				
			|||||||
	CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
 | 
						CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(OS), Windows_NT)
 | 
					ifeq ($(GOOS),windows)
 | 
				
			||||||
	GOFLAGS := -v -buildmode=exe
 | 
						IS_WINDOWS := yes
 | 
				
			||||||
	EXECUTABLE ?= gitea.exe
 | 
					else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
 | 
				
			||||||
else ifeq ($(OS), Windows)
 | 
						ifeq ($(GOOS),)
 | 
				
			||||||
 | 
							IS_WINDOWS := yes
 | 
				
			||||||
 | 
						endif
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					ifeq ($(IS_WINDOWS),yes)
 | 
				
			||||||
	GOFLAGS := -v -buildmode=exe
 | 
						GOFLAGS := -v -buildmode=exe
 | 
				
			||||||
	EXECUTABLE ?= gitea.exe
 | 
						EXECUTABLE ?= gitea.exe
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user