Skip to content

Commit

Permalink
Fix up Makefile to build gcs binaries from /cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Canter <dcanter@microsoft.com>
  • Loading branch information
dcantah committed May 17, 2021
1 parent ef9e281 commit a9a0562
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST))))

# The link aliases for gcstools
GCS_TOOLS=\
generichook
generichook

.PHONY: all always rootfs test

Expand All @@ -31,16 +31,16 @@ clean:
test:
cd $(SRCROOT) && go test ./service/gcsutils/...
cd $(SRCROOT) && go test ./...
cd $(SRCROOT)/service/gcs && ginkgo -r -keepGoing
cd $(SRCROOT)/cmd/gcs && ginkgo -r -keepGoing

out/delta.tar.gz: bin/init bin/vsockexec bin/service/gcs bin/service/gcsutils/gcstools Makefile
out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools Makefile
@mkdir -p out
rm -rf rootfs
mkdir -p rootfs/bin/
cp bin/init rootfs/
cp bin/vsockexec rootfs/bin/
cp bin/service/gcs rootfs/bin/
cp bin/service/gcsutils/gcstools rootfs/bin/
cp bin/cmd/gcs rootfs/bin/
cp bin/cmd/gcstools rootfs/bin/
for tool in $(GCS_TOOLS); do ln -s gcstools rootfs/bin/$$tool; done
git -C $(SRCROOT) rev-parse HEAD > rootfs/gcs.commit && \
git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/gcs.branch
Expand All @@ -59,8 +59,8 @@ out/initrd.img: $(BASE) out/delta.tar.gz $(SRCROOT)/hack/catcpio.sh
gzip -c out/initrd.img.uncompressed > $@
rm out/initrd.img.uncompressed

-include deps/service/gcs.gomake
-include deps/service/gcsutils/gcstools.gomake
-include deps/cmd/gcs.gomake
-include deps/cmd/gcstools.gomake

# Implicit rule for includes that define Go targets.
%.gomake: $(SRCROOT)/Makefile
Expand All @@ -86,4 +86,4 @@ bin/init: init/init.o vsockexec/vsock.o

%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

0 comments on commit a9a0562

Please sign in to comment.