Welcome to the CHICKEN Scheme pasting service

make configuration in salmonella-run-publish added by mario-goulart on Thu Feb 27 13:54:16 2014

(use srfi-1 utils)

(define make-program
  (make-parameter
   (if (eq? (software-version) 'linux)
       "make"
       "gmake")))

;; Default settings.
(define make-options
  (make-parameter
   ;; these default options are required because
   ;; salmonella-run-publish needs these parameters to determine the
   ;; publish directory
   `((PLATFORM    . ,(software-version))
     (C_COMPILER  . "gcc")
     )))

(define (make-command-line . targets)
  (define (assign var val)
    (sprintf "~a=~a"
             var
             (qs (if (list? val)
                     (string-intersperse (map ->string val) " ")
                     (->string val)))))
  (sprintf "~a ~a ~a"
           (make-program)
           (string-intersperse
            (filter-map (lambda (opt/val)
                          (let ((val (cdr opt/val)))
                            (and val
                                 (assign (car opt/val) val))))
                        (make-options)))
           (string-intersperse (map ->string targets))))


;; testing
(make-options
 (append (alist-update 'C_COMPILER "clang" (make-options))
         `((DEBUGBUILD . 1)
           (CXX_COMPILER . clang))))

(print (make-command-line 'spotless 'install))
;; => make PLATFORM='linux' C_COMPILER='clang' DEBUGBUILD='1' CXX_COMPILER='clang' spotless install

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which backend storage does qwiki use?
Visually impaired? Let me spell it for you (wav file) download WAV