makefile: fix redundant path separators

This commit is contained in:
Matthew Flatt 2018-11-29 10:08:19 -07:00
parent e607ae09de
commit 2e3b16f77c
2 changed files with 12 additions and 3 deletions

View File

@ -4,6 +4,7 @@
(define same-up? #f)
(define exec? #f)
(define no-trailing-sep? #f)
(define-values (orig-p extras)
(command-line
@ -12,6 +13,8 @@
(set! same-up? #t)]
[("--exec") "Find executable path"
(set! exec? #t)]
[("--no-trailing-sep") "Avoid a trailing \"/\""
(set! no-trailing-sep? #t)]
#:args
(path . extra)
(values path extra)))
@ -29,8 +32,14 @@
p)
p))
orig-p))
(define (fix-trailing p)
(if no-trailing-sep?
(let-values ([(base name dir?) (split-path p)])
(build-path base name))
p))
(display (simplify-path (path->complete-path p)))])
(display (fix-trailing (simplify-path (path->complete-path p))))])
;; In case there are extra arguments to an executable, preserve them
(for ([e (in-list extras)])

View File

@ -57,8 +57,8 @@ SETUP_COMMON_BOOT = -l- setup $(SETUP_BOOT_MODE) $(srcdir)/../../setup-go.rkt $(
ABS_BOOT = $(SETUP_COMMON_BOOT) ignored $(builddir)/ignored.d
ABS_RACKET = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt --exec $(RACKET)`"
ABS_SCHEME_SRC = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt $(SCHEME_SRC)`"
ABS_SRCDIR = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt $(srcdir)`"
ABS_BUILDDIR = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt $(builddir)`"
ABS_SRCDIR = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt --no-trailing-sep $(srcdir)`"
ABS_BUILDDIR = "`$(RACKET) $(ABS_BOOT) $(srcdir)/../absify.rkt --no-trailing-sep $(builddir)`"
SETUP_BOOT = -O 'info@compiler/cm' $(SETUP_COMMON_BOOT)