Skip to content

Commit

Permalink
fix makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuCoder committed Jan 16, 2023
1 parent 4635ae3 commit 39fc02e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ EXTENSION :=
ifeq ($(OS),Windows_NT)
EXTENSION += .exe
endif
dir_guard=@mkdir -p $(@D)
PROJECTS = $(shell find exes/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n')
BINS=$(PROJECTS:%=build/bin/%$(EXTENSION))

# Static libraries
target/release/lib%.a:
Expand All @@ -16,19 +14,20 @@ target/release/%$(EXTENSION):

# Copy static libraries
build/lib/%: target/release/%
$(dir_guard)
cp target/release/$* build/lib
@mkdir -p build/lib
cp target/release/$* build/lib/$*

# Copy executables
build/bin/%$(EXTENSION): target/release/%$(EXTENSION)
$(dir_guard)
cp target/release/$*$(EXTENSION) build/lib/
@mkdir -p build/bin
cp target/release/$*$(EXTENSION) build/bin/$*$(EXTENSION)

# All in one binary
build/bin/nova$(EXTENSION): build/lib/liball_in_one.a
$(dir_guard)
@mkdir -p build/bin
go build -a -ldflags '-s' -o build/bin/nova cmd/nova/nova.go

BINS=$(PROJECTS:%=build/bin/%$(EXTENSION))
all: $(BINS) build/bin/nova$(EXTENSION)

clean:
Expand Down

0 comments on commit 39fc02e

Please sign in to comment.