Files

31 lines
581 B
Racket

#lang racket
(require racket-makefile)
;; Functional use: press Run in DrRacket and use (make 'all), (make 'clean),
;; or call a generated target procedure directly.
(define CC 'cc)
(define CFLAGS '(-Wall -O2))
(makefile 'hello
(default-target 'all)
(phony 'all 'clean 'setup 'test)
(target 'all
(deps "hello"))
(target "hello"
(deps "hello.c")
(run `(,CC ,@CFLAGS -o $target $<)))
(target 'clean
(rm-f "hello")
(rm-rf "compiled"))
(target 'setup
(raco '(setup racket-makefile)))
(target 'test
(raco '(test -p racket-makefile))))