diff options
author | Tom Willemsen | 2012-08-15 00:24:32 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-08-15 00:24:32 +0200 |
commit | 5769114042ec60274d48cb3794c00348ca22da66 (patch) | |
tree | 5c374cb13831cb04104d597a1b2c2461d11c0ed7 /undone | |
parent | 50dc2da0b1710e6f93ffbbfca0db7e9f937a3d8a (diff) | |
download | undone-5769114042ec60274d48cb3794c00348ca22da66.tar.gz undone-5769114042ec60274d48cb3794c00348ca22da66.zip |
Add Makefiles and others
Diffstat (limited to 'undone')
-rw-r--r-- | undone/.gitignore | 1 | ||||
-rw-r--r-- | undone/Makefile | 30 | ||||
-rw-r--r-- | undone/main.scm | 9 |
3 files changed, 37 insertions, 3 deletions
diff --git a/undone/.gitignore b/undone/.gitignore new file mode 100644 index 0000000..e796b66 --- /dev/null +++ b/undone/.gitignore @@ -0,0 +1 @@ +*.go diff --git a/undone/Makefile b/undone/Makefile new file mode 100644 index 0000000..fe92bd7 --- /dev/null +++ b/undone/Makefile @@ -0,0 +1,30 @@ +DESTDIR ?= /usr/local +SITEDIR = $(shell pkg-config guile-2.0 --variable=sitedir \ + --define-variable=prefix=$(DESTDIR)) +COMPDIR = $(DESTDIR)/lib/guile/2.0/site-ccache + +objects = main.scm main.go +install-objects = $(addprefix install-,$(objects)) +uninstall-objects = $(addprefix uninstall-,$(objects)) + +.PHONY: all install $(install-objects) uninstall $(uninstall-objects) + +all: $(filter %.go,$(objects)) + +$(filter %.go,$(objects)): %.go: %.scm + ../env guild compile -o $@ $^ + +install: $(install-objects) +uninstall: $(uninstall-objects) + +$(filter %.go,$(install-objects)): install-%: $(filter %.go,$(objects)) + install -Dm 644 $* "$(COMPDIR)/undone/$*" + +$(filter %.scm,$(install-objects)): install-%: + install -Dm 644 $* "$(SITEDIR)/undone/$*" + +$(filter %.go,$(uninstall-objects)): uninstall-%: + rm -f "$(COMPDIR)/undone/$*" + +$(filter %.scm,$(uninstall-objects)): uninstall-%: + rm -f "$(SITEDIR)/undone/$*" diff --git a/undone/main.scm b/undone/main.scm index 663aa1e..18beab3 100644 --- a/undone/main.scm +++ b/undone/main.scm @@ -129,7 +129,12 @@ (apply view-func '())))) (define (main args) - (load rc-file) + ;; Ugly hack, can't think of a better way right now... + (save-module-excursion + (lambda () + (set-current-module (resolve-module '(undone main))) + (load rc-file))) + (if (> (length args) 1) (case (string->symbol (cadr args)) ((add) @@ -144,5 +149,3 @@ (format #t "~a~20t~a~%" (car view) (procedure-documentation (cdr view)))) view-list))))) - -(main (program-arguments)) |