(require :asdf)

(defparameter *libs* (list :cl-ppcre))

#.(progn
  (let ((quicklisp-init (merge-pathnames ".quicklisp/setup.lisp"
                                         (user-homedir-pathname))))
    (when (probe-file quicklisp-init)
      (load quicklisp-init))))

#.(loop for s in *libs*
        do (print s)
        do (ql:quickload s)
        (asdf:make-build s
                         :type :shared-library
                         :move-here T))

(setf
  ext:*bytecodes-compiler* nil
  c::*compile-in-constants* t)

(asdf:oos 'asdf:load-op :test)

(asdf:make-build :test
                 :type :program
                 :monolithic nil
                 :ld-flags (list*
                             "-Lasdf-output/"
                             (mapcar
                               (lambda (l)
                                 (format nil "-l~(~a~)" l))
                               *libs*))
                 :epilogue-code '(main)
                 :move-here T)
