1
1
Fork 0
mirror of https://github.com/OJ/gobuster.git synced 2024-05-04 10:36:06 +02:00
gobuster/Makefile
Christian Mehlmauer 6a2b40ff86
Cherry-picked the gomodules code from #117
This was cherry-picked from the gomod branch instead of being merged as
a PR for two reasons:

1) The vhost plugin addition isn't yet ready for merging, as there's
   a lot of code duplication.
2) This code can technically be merged as is without the mods to the
   vhost plugin.

When/If we're ready to merge the vhost plugin we'll fix that side up.
2019-01-09 11:17:46 +10:00

49 lines
1.3 KiB
Makefile

TARGET=./build
ARCHS=amd64 386
LDFLAGS="-s -w"
GCFLAGS="all=-trimpath=${GOPATH}/src"
ASMFLAGS="all=-trimpath=${GOPATH}/src"
current:
@go build -o ./gobuster; \
echo "Done."
update:
@go get -u; \
go mod tidy; \
echo "Done."
windows:
@for GOARCH in ${ARCHS}; do \
echo "Building for windows $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-windows-$${GOARCH} ; \
GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-windows-$${GOARCH}/gobuster.exe ; \
done; \
echo "Done."
linux:
@for GOARCH in ${ARCHS}; do \
echo "Building for linux $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-linux-$${GOARCH} ; \
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-linux-$${GOARCH}/gobuster ; \
done; \
echo "Done."
darwin:
@for GOARCH in ${ARCHS}; do \
echo "Building for darwin $${GOARCH} ..." ; \
mkdir -p ${TARGET}/gobuster-darwin-$${GOARCH} ; \
GOOS=darwin GOARCH=$${GOARCH} GO111MODULE=on go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/gobuster-darwin-$${GOARCH}/gobuster ; \
done; \
echo "Done."
all: update darwin linux windows
test:
@go test -v -race ./... ; \
echo "Done."
clean:
@rm -rf ${TARGET}/* ; \
echo "Done."