-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine Makefile for enhanced build process.
- Loading branch information
1 parent
80111ed
commit 241abf5
Showing
1 changed file
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
all: build | ||
docker: docker-build docker-push | ||
# Define variables for repeated values | ||
DOCKER_TAG := kerwenwwer/gossip-service:latest | ||
|
||
.PHONY: bpf/*.o | ||
bpf/*.o: bpf/*.c | ||
# Phony targets for workflows | ||
.PHONY: all bpf-objects build docker-build docker-push | ||
|
||
# Default target to compile the application and build the Docker image | ||
all: build docker-build | ||
|
||
# Rule to generate BPF object files from C source | ||
bpf-objects: | ||
go generate ./bpf/ | ||
|
||
.PHONY: build | ||
build: bpf/*.o | ||
# Rule to build the main application | ||
build: bpf-objects | ||
go build -o ./bin/xdp-gossip ./main.go | ||
|
||
.PHONY: docker-build | ||
# Rule to build the Docker image | ||
docker-build: | ||
docker build -t kerwenwwer/gossip-service:latest . | ||
docker build -t $(DOCKER_TAG) . | ||
|
||
.PHONY: docker-push | ||
# Rule to push the Docker image to the repository | ||
docker-push: | ||
docker push kerwenwwer/gossip-service:latest | ||
|
||
.PHONY: docker-up | ||
docker-up: | ||
docker-compose up --build | ||
docker push $(DOCKER_TAG) |