Skip to content
GitLab
Explore
Sign in
This is an archived project. Repository and other project resources are read-only.
Changes
Page history
Update utilisation du makefile
authored
Jan 12, 2018
by
Arthur Dewarumez
Show whitespace changes
Inline
Side-by-side
utilisation-du-makefile.md
View page @
8168b95b
...
@@ -27,3 +27,35 @@ Il est possible de modifier certaines variables lors de l'exécution de certaine
...
@@ -27,3 +27,35 @@ Il est possible de modifier certaines variables lors de l'exécution de certaine
### test
### test
-
**GO_TEST_PARAM**
pour ajouter des options particulières à
*go test*
. Par défaut
*-cover*
.
-
**GO_TEST_PARAM**
pour ajouter des options particulières à
*go test*
. Par défaut
*-cover*
.
## Template de base
```
makefile
include
../../Makefile.var
BINARY
:=
put a name here
init
:
@
echo
"Initialising
${
PROJECT
}
project"
@${
DEP_MANAGER
}
install
clean
:
@
echo
"Cleaning
${
PROJECT
}
project"
-
@rm
-r
${
BINARY
}
build
:
@
echo
"Building
${
PROJECT
}
project"
@
env
GOOS
=
$(
OS
)
GOARCH
=
$(
ARCH
)
CGO_ENABLED
=
$(
CGO
)
go build
-o
${
OUTPUT_DIR
}
/
${
BINARY
}
${
LDFLAGS
}
full_clean
:
clean
@
echo
"Purging
${
PROJECT
}
project"
-
@rm
-r
${
VENDOR_DIR
}
@${
DEP_MANAGER
}
cache-clear
docker_build
:
@
echo
"Building
${
PROJECT
}
project docker image"
@
docker build
.
--build-arg
BINARY_NAME
=
${
BINARY
}
--build-arg
PROJECT_NAME
=
${
PROJECT
}
-t
${
IMAGE_NAME
}
:
${
TAG
}
test
:
build
@
echo
"Testing
${
PROJECT
}
project"
@
go
test
${
GO_TEST_PARAM
}
```
\ No newline at end of file