From 25982a628d3dc194e52708fd429a81746d1890a1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 May 2024 12:55:28 -0500 Subject: Correct path stuff for build/ building --- Makefile | 9 +++++---- scramble.scm | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2ac521f..7ecdf53 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,11 @@ TESTS = $(PWD)/tests TEST_ENV = env BUILD=$(BUILD) TESTS=$(TESTS) .PHONY: all test clean install uninstall -all: /home/acdw/src/scramble/build/scramble +all: build/scramble test: $(BUILD) cd $(BUILD) && $(TEST_ENV) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME) clean: - -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.import.so *.link *.static.o + -rm -rf $(BUILD) *.build.sh *.install.sh $(NAME) *.import.scm *.so *.link *.static.o install: chicken-install -s uninstall: @@ -25,6 +25,7 @@ uninstall: $(BUILD): -mkdir $(BUILD) -/home/acdw/src/scramble/build/scramble: /home/acdw/src/scramble/scramble.scm $(BUILD) - $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) $< -o $@ +build/scramble: scramble.scm $(BUILD) + cd $(BUILD) && \ + $(CSC) $(CSC_OPTIONS) $(CSC_OPTIONS_EXTRA) ../$< -o $(@F) @if test -f scramble.import.scm;then mv scramble.import.scm $(BUILD)/;echo mv scramble.import.scm $(BUILD)/; fi diff --git a/scramble.scm b/scramble.scm index 7af5282..79d6874 100644 --- a/scramble.scm +++ b/scramble.scm @@ -119,14 +119,15 @@ (define (rule c) (let ((deps (alist-ref c (dependency-graph)))) - (sprintf "~a: ~a $(BUILD)\n\t~a\n\t~a" + (sprintf "~a: ~a $(BUILD)\n\t~a\n\t~a\n\t~a" (relativize (output-of c)) (string-join (cons (relativize (source-of (car deps))) (map (o relativize output-of) (cdr deps)))) + "cd $(BUILD) && \\" (string-append "$(CSC) $(CSC_OPTIONS)" (if (eq? (car (find-component c)) 'extension) " $(CSC_LIB_OPTIONS)" "") - " $(CSC_OPTIONS_EXTRA) $< -o $@") + " $(CSC_OPTIONS_EXTRA) ../$< -o $(@F)") (string-append "@if test -f " (->string c) ".import.scm;" "then mv " (->string c) ".import.scm $(BUILD)/;" "echo mv " (->string c) ".import.scm $(BUILD)/;" @@ -163,7 +164,7 @@ "$(TEST_ENV) $(CSI) -setup-mode -s $(TESTS)/run.scm $(NAME)") (print "clean:\n\t-rm -rf $(BUILD)" " *.build.sh *.install.sh $(NAME)" - " *.import.scm *.import.so *.link *.static.o") + " *.import.scm *.so *.link *.static.o") (print "install:\n\tchicken-install -s") (print "uninstall:\n\tchicken-uninstall -s") (newline) (print "# " (egg-name)) (newline) -- cgit 1.4.1-21-gabe81