Skip to content

Commit

Permalink
Update Makefile: go vendor must inside the GOPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
hmgle committed Aug 6, 2018
1 parent a6d0e2b commit f5f7ebc
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ endif

SRC := $(wildcard *.c)

TARGET = graftcp graftcp-local/graftcp-local
GRAFTCP_LOCAL_BIN = $(GOPATH)/bin/graftcp-local
TARGET = graftcp $(GRAFTCP_LOCAL_BIN)

all:: $(TARGET)

Expand All @@ -40,31 +41,28 @@ graftcp: main.o util.o string-set.o
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<

graftcp-local/graftcp-local: graftcp-local/*.go
cd graftcp-local && go build
$(GRAFTCP_LOCAL_BIN)::
go get -v github.com/hmgle/graftcp/graftcp-local

install:: graftcp graftcp-local/graftcp-local
install:: graftcp $(GRAFTCP_LOCAL_BIN)
$(INSTALL) $< $(BINDIR); \
cd graftcp-local && ./graftcp-local -service install && \
./graftcp-local -service start
graftcp-local -service install && graftcp-local -service start

uninstall:: graftcp-local/graftcp-local
uninstall:: $(GRAFTCP_LOCAL_BIN)
-rm -f $(BINDIR)/graftcp; \
cd graftcp-local && ./graftcp-local -service uninstall
graftcp-local -service uninstall

install_graftcp:: graftcp
$(INSTALL) $< $(BINDIR)

uninstall_graftcp::
-rm -f $(BINDIR)/graftcp

install_graftcp_local:: graftcp-local/graftcp-local
cd graftcp-local && ./graftcp-local -service install && \
./graftcp-local -service restart
install_graftcp_local:: $(GRAFTCP_LOCAL_BIN)
graftcp-local -service install && graftcp-local -service restart

uninstall_graftcp_local:: graftcp-local/graftcp-local
cd graftcp-local && ./graftcp-local -service stop && \
./graftcp-local -service uninstall
uninstall_graftcp_local:: $(GRAFTCP_LOCAL_BIN)
graftcp-local -service stop && graftcp-local -service uninstall

sinclude $(SRC:.c=.d)

Expand Down

0 comments on commit f5f7ebc

Please sign in to comment.