Files
racket-makefile/README.md
T
2026-08-08 14:32:18 +02:00

1.2 KiB

racket-makefile

racket-makefile is a small #lang for make-style builds. It keeps ordinary Racket available and only adds targets, dependencies, timestamp based rebuilds, phony targets, external command execution and a few cleanup helpers.

#lang racket-makefile

(define CC 'cc)
(define CFLAGS '(-Wall -O2))

(default-target all)
(phony all clean)

(target all
  (deps "hello"))

(target "hello"
  (deps "hello.c")
  (run `(,CC ,@CFLAGS -o $target $<)))

(target clean
  (rm-f "hello")
  (rm-rf "compiled")
  (cleanup "scrbl" '("**.html" "**.js" "**.css")))

Install a local checkout with:

raco pkg install

For a versioned archive, give the package name explicitly:

raco pkg install --name racket-makefile racket-makefile-0.1.1.zip

Run the default target or select one or more targets explicitly:

racket Makefile.rkt
racket Makefile.rkt clean
racket Makefile.rkt clean all

The language adds target, deps, phony, default-target, run, rm-f, rm-rf, cleanup, $target, $deps and $<. Dependency expressions may also produce lists, which are automatically flattened. Everything else is ordinary Racket.

See the installed racket-makefile Scribble documentation for the full API.