-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
132 additions
and
13 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 |
---|---|---|
|
@@ -25,4 +25,5 @@ _testmain.go | |
*.txt | ||
*.swp | ||
|
||
gobuster | ||
gobuster | ||
build |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
TARGET=./build | ||
OSES=darwin linux windows | ||
ARCHS=amd64 386 | ||
|
||
current: outputdir | ||
This comment has been minimized.
Sorry, something went wrong. |
||
@go build -o ./gobuster; \ | ||
echo "Done." | ||
|
||
outputdir: | ||
@mkdir -p ${TARGET} | ||
|
||
windows: outputdir | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Building for windows $${GOARCH} ..." ; \ | ||
GOOS=windows GARCH=$${GOARCH} go build -o ${TARGET}/gobuster-$${GOARCH}.exe ; \ | ||
done; \ | ||
echo "Done." | ||
|
||
linux: outputdir | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Building for linux $${GOARCH} ..." ; \ | ||
GOOS=linux GARCH=$${GOARCH} go build -o ${TARGET}/gobuster-linux-$${GOARCH} ; \ | ||
done; \ | ||
echo "Done." | ||
|
||
darwin: outputdir | ||
@for GOARCH in ${ARCHS}; do \ | ||
echo "Building for darwin $${GOARCH} ..." ; \ | ||
GOOS=darwin GARCH=$${GOARCH} go build -o ${TARGET}/gobuster-darwin-$${GOARCH} ; \ | ||
done; \ | ||
echo "Done." | ||
|
||
|
||
all: darwin linux windows | ||
|
||
test: | ||
@go test -v -race ./... ; \ | ||
echo "Done." | ||
|
||
clean: | ||
@rm -rf ${TARGET}/* ; \ | ||
echo "Done." |
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
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
@echo off | ||
|
||
SET ARG=%1 | ||
SET TARGET=.\build | ||
|
||
IF "%ARG%"=="test" ( | ||
go test -v -race ./... | ||
echo Done. | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="clean" ( | ||
del /F /Q %TARGET%\*.* | ||
echo Done. | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="windows" ( | ||
CALL :Windows | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="darwin" ( | ||
CALL :Darwin | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="linux" ( | ||
CALL :Linux | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="all" ( | ||
CALL :Darwin | ||
CALL :Linux | ||
CALL :Windows | ||
GOTO Done | ||
) | ||
|
||
IF "%ARG%"=="" ( | ||
go build -o .\gobuster.exe | ||
GOTO Done | ||
) | ||
|
||
GOTO Done | ||
|
||
:Darwin | ||
set GOOS=darwin | ||
set GOARCH=amd64 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOOS%-%GOARCH% | ||
set GOARCH=386 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOOS%-%GOARCH% | ||
echo Done. | ||
EXIT /B 0 | ||
|
||
:Linux | ||
set GOOS=linux | ||
set GOARCH=amd64 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOOS%-%GOARCH% | ||
set GOARCH=386 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOOS%-%GOARCH% | ||
echo Done. | ||
EXIT /B 0 | ||
|
||
:Windows | ||
set GOOS=windows | ||
set GOARCH=amd64 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOARCH%.exe | ||
set GOARCH=386 | ||
echo Building for %GOOS% %GOARCH% ... | ||
go build -o %TARGET%\gobuster-%GOARCH%.exe | ||
echo Done. | ||
EXIT /B 0 | ||
|
||
:Done |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
As we now have a Makefile Travis will use it on new commits (https://docs.travis-ci.com/user/languages/go/#default-build-script). We should define a default goal (
.DEFAULT_GOAL := xxxxx
) which includes tests so the unit tests are run on Travis too.