-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 878 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Makefile for C2PA Remover
# Builds both native and WebAssembly versions
# Go compiler
GO := go
GOFLAGS := -v
# Project name and binaries
PROJECT_NAME := c2paremover
NATIVE_BIN := $(PROJECT_NAME)
WASM_BIN := $(PROJECT_NAME).wasm
# Build all targets by default
all: build wasm
# Build native binary
build:
@echo "Building native binary..."
$(GO) build $(GOFLAGS) -o $(NATIVE_BIN)
# Build WebAssembly binary
wasm:
@echo "Building WebAssembly binary..."
GOOS=wasip1 GOARCH=wasm $(GO) build $(GOFLAGS) -tags=wasmer -o $(WASM_BIN)
# Run tests
test:
@echo "Running tests..."
$(GO) test $(GOFLAGS) ./...
# Clean up build artifacts
clean:
@echo "Cleaning up..."
rm -f $(NATIVE_BIN) $(WASM_BIN)
# Install the native binary
install: build
@echo "Installing binary..."
install -m 755 $(NATIVE_BIN) /usr/local/bin/$(NATIVE_BIN)
.PHONY: all build wasm test clean install