-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|