build: disable CGO for pure Go compilation with puregotk
- commit
- e4dcc499019ee708f1ba8f212fa5848d41ee0b77
- author
- bnema · · 2025-12-17 18:48 UTC
- parent
- dfddb9f
- signature
- unsigned
1 file · +2 -2
M Makefile +2 -2
| @@ -33,7 +33,7 @@ help: ## Show this help message | |||
| 33 | 33 | build: build-frontend ## Build the application (pure Go, no CGO) | |
| 34 | 34 | @echo "Building $(BINARY_NAME) $(VERSION) using $(NPROCS) cores..." | |
| 35 | 35 | @mkdir -p $(DIST_DIR) | |
| 36 | - | go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | |
| 36 | + | CGO_ENABLED=0 go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | |
| 37 | 37 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | |
| 38 | 38 | ||
| 39 | 39 | build-frontend: ## Build homepage and blocked pages | |
| @@ -44,7 +44,7 @@ build-frontend: ## Build homepage and blocked pages | |||
| 44 | 44 | build-quick: ## Build without frontend (faster for backend development) | |
| 45 | 45 | @echo "Building $(BINARY_NAME) $(VERSION) (quick, no frontend)..." | |
| 46 | 46 | @mkdir -p $(DIST_DIR) | |
| 47 | - | go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | |
| 47 | + | CGO_ENABLED=0 go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | |
| 48 | 48 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | |
| 49 | 49 | ||
| 50 | 50 | # Development targets | |
| @@ -33,7 +33,7 @@ help: ## Show this help message | |||||
| 33 | build: build-frontend ## Build the application (pure Go, no CGO) | 33 | build: build-frontend ## Build the application (pure Go, no CGO) | ||
| 34 | @echo "Building $(BINARY_NAME) $(VERSION) using $(NPROCS) cores..." | 34 | @echo "Building $(BINARY_NAME) $(VERSION) using $(NPROCS) cores..." | ||
| 35 | @mkdir -p $(DIST_DIR) | 35 | @mkdir -p $(DIST_DIR) | ||
| 36 | - | go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | 36 | + | CGO_ENABLED=0 go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) |
| 37 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | 37 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | ||
| 38 | 38 | ||||
| 39 | build-frontend: ## Build homepage and blocked pages | 39 | build-frontend: ## Build homepage and blocked pages | ||
| @@ -44,7 +44,7 @@ build-frontend: ## Build homepage and blocked pages | |||||
| 44 | build-quick: ## Build without frontend (faster for backend development) | 44 | build-quick: ## Build without frontend (faster for backend development) | ||
| 45 | @echo "Building $(BINARY_NAME) $(VERSION) (quick, no frontend)..." | 45 | @echo "Building $(BINARY_NAME) $(VERSION) (quick, no frontend)..." | ||
| 46 | @mkdir -p $(DIST_DIR) | 46 | @mkdir -p $(DIST_DIR) | ||
| 47 | - | go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) | 47 | + | CGO_ENABLED=0 go build -p $(NPROCS) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME) $(MAIN_PATH) |
| 48 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | 48 | @echo "Build successful! Binary: $(DIST_DIR)/$(BINARY_NAME)" | ||
| 49 | 49 | ||||
| 50 | # Development targets | 50 | # Development targets | ||