Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
forks
ble
Commits
f47f4eec
Commit
f47f4eec
authored
May 26, 2016
by
Tzu-Jung Lee
Browse files
examples: modify Makefile for the ease of development iterations
parent
a03eed52
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/Makefile
View file @
f47f4eec
# PROGS ?= $(notdir $(shell go list ./...))
PROGS
?=
$(
filter-out
bin Makefile,
$(
shell
ls
))
BUILD_CMD
?=
GOGC
=
off
GOOS
=
linux go build
$(LDFLAGS)
-i
-o
bin/
$@
$@
/
*
.go
DEPLOY_CMD
?=
scp bin/
$<
gentoo:/tmp
RUN_CMD
?=
ssh
-t
gentoo
sudo
LOGXI
=
${LOGXI}
/tmp/
$<
.PHONY
:
$(PROGS)
Q
?=
@
...
...
@@ -15,20 +19,11 @@ LDFLAGS ?= -ldflags="-w -X $(BUILDDATESYM)=$(BUILDDATE) -X $(GITSYM)=$(GITHEAD)
all
:
$(PROGS)
list
:
$(Q)
echo
$(PROGS)
prepare
:
$(Q)
mkdir
-p
bin
run-%
:
bin/%
$(Q)
echo
Running prebuilt bin/
$@
...
sudo
LOGXI
=
${LOGXI}
$<
$(PROGS)
:
$(Q)
echo
Building bin/
$@
...
$(Q)
GOGC
=
off
GOOS
=
linux go build
$(LDFLAGS)
-o
bin/
$@
$@
/
*
.go
sudo
LOGXI
=
${LOGXI}
bin/
$@
$(Q)
$(BUILD_CMD)
run-%
:
%
$(Q)
$(DEPLOY_CMD)
$(Q)
$(RUN_CMD)
clean
:
$(Q)
rm
-rf
bin
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment