diff options
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | gitto/.gitignore | 1 | ||||
-rw-r--r-- | gitto/Makefile | 25 | ||||
-rw-r--r--[-rwxr-xr-x] | gitto/main.scm (renamed from gitto.scm) | 13 | ||||
-rwxr-xr-x | run-gitto | 5 | ||||
-rw-r--r-- | src/Makefile | 11 | ||||
-rwxr-xr-x | src/gitto | 4 |
7 files changed, 72 insertions, 7 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5c2306a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +export DESTDIR ?= /usr + +dirs = src gitto +install-dirs = $(addprefix install-,$(dirs)) +uninstall-dirs = $(addprefix uninstall-,$(dirs)) + +.PHONY: all $(dirs) install $(install-dirs) uninstall $(uninstall-dirs) + +all: $(dirs) +install: $(install-dirs) +uninstall: $(uninstall-dirs) + +$(dirs): + $(MAKE) -C $@/ + +$(install-dirs): install-%: + $(MAKE) -C $*/ install + +$(uninstall-dirs): uninstall-%: + $(MAKE) -C $*/ uninstall diff --git a/gitto/.gitignore b/gitto/.gitignore new file mode 100644 index 0000000..e796b66 --- /dev/null +++ b/gitto/.gitignore @@ -0,0 +1 @@ +*.go diff --git a/gitto/Makefile b/gitto/Makefile new file mode 100644 index 0000000..4c4f95e --- /dev/null +++ b/gitto/Makefile @@ -0,0 +1,25 @@ +DESTDIR ?= /usr/local + +objects = main.go main.scm +install-objects = $(addprefix install-,$(objects)) +uninstall-objects = $(addprefix uninstall-,$(objects)) + +$(filter %.go,$(objects)): %.go: %.scm + guile-tools compile -o $@ $^ + +.PHONY: install $(install-objects) uninstall $(uninstall-objects) + +install: $(install-objects) +uninstall: $(uninstall-objects) + +$(filter %.go,$(install-objects)): install-%: + install -Dm 644 $* $(DESTDIR)/lib/guile/2.0/ccache/gitto/$* + +$(filter %.scm,$(install-objects)): install-%: + install -Dm 644 $* $(DESTDIR)/share/guile/2.0/gitto/$* + +$(filter %.go,$(uninstall-objects)): uninstall-%: + rm -f $(DESTDIR)/lib/guile/2.0/ccache/gitto/$* + +$(filter %.scm,$(uninstall-objects)): uninstall-%: + rm -f $(DESTDIR)/share/guile/2.0/gitto/$* diff --git a/gitto.scm b/gitto/main.scm index 75b0aff..e6624e4 100755..100644 --- a/gitto.scm +++ b/gitto/main.scm @@ -1,10 +1,9 @@ -#! /usr/bin/guile \ --e main -s -!# -(use-modules (ice-9 format) - (ice-9 getopt-long) - (ice-9 popen) - (ice-9 rdelim)) +(define-module (gitto main) + #:use-module (ice-9 format) + #:use-module (ice-9 getopt-long) + #:use-module (ice-9 popen) + #:use-module (ice-9 rdelim) + #:export (main)) (define data-dir (let ((xdg (getenv "XGD_DATA_HOME")) diff --git a/run-gitto b/run-gitto new file mode 100755 index 0000000..9f45893 --- /dev/null +++ b/run-gitto @@ -0,0 +1,5 @@ +#!/bin/sh + +export GUILE_LOAD_PATH="$(dirname $(realpath $0)):$GUILE_LOAD_PATH" +export GUILE_LOAD_COMPILED_PATH="$(dirname $(realpath $0)):$GUILE_LOAD_PATH" +exec src/gitto "$@" diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..61946a0 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,11 @@ +DESTDIR ?= /usr/local + +all: + +.PHONY: install uninstall + +install: gitto + install -Dm 755 $^ ${DESTDIR}/bin/$^ + +uninstall: gitto + rm -f ${DESTDIR}/bin/$^ diff --git a/src/gitto b/src/gitto new file mode 100755 index 0000000..2f86f74 --- /dev/null +++ b/src/gitto @@ -0,0 +1,4 @@ +#!/bin/sh + +BOOT="((@ (gitto main) main) (program-arguments))" +exec guile $GUILE_FLAGS -c "$BOOT" "$0" "$@" |