Added framework for experimenting using Go.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Mon, 3 May 2021 03:38:24 +0000 (20:38 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Mon, 3 May 2021 03:38:24 +0000 (20:38 -0700)
chapter-1-experiments/Makefile [new file with mode: 0644]
chapter-1-experiments/ch1-breeding-numbers.go [new file with mode: 0644]
common/mk.conf [new file with mode: 0644]

diff --git a/chapter-1-experiments/Makefile b/chapter-1-experiments/Makefile
new file mode 100644 (file)
index 0000000..e3e9265
--- /dev/null
@@ -0,0 +1,29 @@
+# © 2021 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# See LICENSE.txt file for copyright and license details.
+
+####################################################################################################
+# Program-specific options
+
+SOURCE != ls *.go
+BINARY := ${SOURCE:.go=}
+
+####################################################################################################
+# Globally-mandated options
+
+include ../common/mk.conf
+
+all: ${BINARY}
+
+.go:
+       @${GOCC} ${GOCC_FLAGS} ${GOLD_FLAGS} -o $@ $<
+
+clean:
+       @rm -f ${BINARY}
+
+install: all
+       @mkdir -p ${BINPREFIX}
+       @cp -f ${BINARY} ${BINPREFIX}/surreal-${BINARY}
+       @chmod 755 ${BINPREFIX}/surreal-${BINARY}
+
+uninstall: all
+       @rm -f ${BINPREFIX}/surreal-${BINARY}
diff --git a/chapter-1-experiments/ch1-breeding-numbers.go b/chapter-1-experiments/ch1-breeding-numbers.go
new file mode 100644 (file)
index 0000000..1e53fc3
--- /dev/null
@@ -0,0 +1,12 @@
+// (c) 2020 Aaron Taylor <ataylor at subgeniuskitty dot com>
+// See LICENSE.txt file for copyright and license details.
+
+package main
+
+import (
+    "fmt"
+)
+
+func main() {
+    fmt.Println("Hello, World!")
+}
diff --git a/common/mk.conf b/common/mk.conf
new file mode 100644 (file)
index 0000000..3fa6ba1
--- /dev/null
@@ -0,0 +1,21 @@
+# © 2021 Aaron Taylor <ataylor at subgeniuskitty dot com>
+# See LICENSE.txt file for copyright and license details.
+
+####################################################################################################
+# Installation Paths
+
+PREFIX = /home/ataylor/
+BINPREFIX = ${PREFIX}/bin
+
+####################################################################################################
+# Configuration
+
+CC              = cc
+CC_FLAGS        = -Wall -std=c99 -pedantic -Wno-deprecated-declarations -O2
+LD_FLAGS        = 
+
+GOCC       = go build
+GOCC_FLAGS = 
+GOLD_FLAGS = 
+
+.SUFFIXES: .go .c