Skip to content

Commit

Permalink
pvlv makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall C. O'Reilly committed Nov 23, 2020
1 parent afa08f4 commit 80e3790
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions ch7/pvlv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Makefile for CCN sims projects

# important: update these for each app
ASSETS=

# default package install
PKGDIR=$(HOME)/ccnsimpkg

# app is assumed to be the same as the directory name
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
penultimateword=$(wordlist $(words $1),$(words $1), x $1)

APP=$(current_dir)
CHAP=$(call penultimateword, $(subst /, ,$(dir $(mkfile_path))))
PLATFORM=$@
DEST=$(PKGDIR)/$(PLATFORM)/$(CHAP)

# all std go defs
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get

all: build

build:
$(GOBUILD) -v
dbg-build:
$(GOBUILD) -v -gcflags=all="-N -l" -tags debug
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)

# must do: go get github.com/shuLhan/go-bindata -- go install in cmd/go-bindata
bindata:
go-bindata $(ASSETS)
mac: build
- mkdir -p $(DEST)
- /bin/cp $(APP) $(DEST)
linux: build
- mkdir -p $(DEST)
- /bin/cp $(APP) $(DEST)
windows: build
- mkdir -p $(DEST)
- /bin/cp $(APP) $(DEST)

0 comments on commit 80e3790

Please sign in to comment.