diff options
| author | James O'Doherty <james@theodohertyfamily.com> | 2026-05-22 10:05:38 -0400 |
|---|---|---|
| committer | James O'Doherty <james@theodohertyfamily.com> | 2026-05-22 10:05:38 -0400 |
| commit | 764d3e67fc783c487f42d398d1b85a5a1f0d8ef0 (patch) | |
| tree | 5eed72f4e2371efe4d341fe61ce8bcf7717ac780 /Makefile | |
| parent | a78401b6b5023c3c924c0884b222c329975b3ad6 (diff) | |
feat: implement rootless network isolation bootstrap and C launcher
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0ef54dd --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +# Compiler and flags +CC = gcc +CFLAGS = -static -O2 +GO_BUILD_FLAGS = -v +CGO_ENABLED = 1 + +# Paths +LAUNCHER_SRC = internal/namespace/launcher_src/launcher.c +LAUNCHER_BIN = internal/namespace/launcher.bin +BINARY = wg-wrap + +.PHONY: all clean test + +# Default target: build the final binary +all: $(BINARY) + +# Build the Go binary +$(BINARY): $(LAUNCHER_BIN) + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_BUILD_FLAGS) -o $(BINARY) cmd/wg-wrap/main.go + +# Build the embedded C launcher binary +$(LAUNCHER_BIN): $(LAUNCHER_SRC) + $(CC) $(CFLAGS) $(LAUNCHER_SRC) -o $(LAUNCHER_BIN) + +# Run tests +test: all + go test -v ./... + +# Clean up all artifacts +clean: + rm -f $(BINARY) $(LAUNCHER_BIN) + find . -name "*.test" -delete |
