Skip to content

Commit

Permalink
Reorganize file layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Dec 9, 2012
1 parent df075d7 commit 12f8b2c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
29 changes: 20 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
GOPATH := $(PWD)
# Use shadowsocks as command prefix to avoid name conflict
# Maybe ss-local/server is better because easier to type
PREFIX := shadowsocks
LOCAL := $(GOBIN)/$(PREFIX)-local
SERVER := $(GOBIN)/$(PREFIX)-server
TEST := $(GOBIN)/$(PREFIX)-test

all: bin/local bin/server bin/test
# TODO define the install package path for use in clean and detect whether
# package need re-build

all: $(LOCAL) $(SERVER) $(TEST)

.PHONY: clean

clean:
rm -rf bin/* pkg/*
rm -rf $(LOCAL) $(SERVER) $(TEST)

bin/local: src/shadowsocks/*.go src/local/*.go
go install local
$(LOCAL): shadowsocks/*.go cmd/$(PREFIX)-local/*.go
cd shadowsocks; go install
cd cmd/$(PREFIX)-local; go install

bin/server: src/shadowsocks/*.go src/server/*.go
go install server
$(SERVER): shadowsocks/*.go cmd/$(PREFIX)-server/*.go
cd shadowsocks; go install
cd cmd/$(PREFIX)-server; go install

bin/test: src/shadowsocks/*.go src/test/*.go
go install test
$(TEST): shadowsocks/*.go cmd/$(PREFIX)-test/*.go
cd shadowsocks; go install
cd cmd/$(PREFIX)-test; go install
2 changes: 1 addition & 1 deletion src/local/local.go → cmd/shadowsocks-local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"
"net"
"shadowsocks"
"github.com/cyfdecyf/shadowsocks-go/shadowsocks"
)

func handleConnection(conn net.Conn, server string) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/server.go → cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"log"
"net"
"shadowsocks"
"github.com/cyfdecyf/shadowsocks-go/shadowsocks"
)

func handleConnection(conn shadowsocks.Conn) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/test.go → cmd/shadowsocks-test/test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"shadowsocks"
"github.com/cyfdecyf/shadowsocks-go/shadowsocks"
"log"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 12f8b2c

Please sign in to comment.