📄 makefile.lsp
字号:
;; makefile.lsp -- builds makefiles for various machine types(setf system-types '(rs6k next pmax sparc sgi linux))(if (not (boundp 'system-type)) (setf system-type nil))(if (not (boundp 'target-file)) (setf target-file "ny"))(format t "System types: ~A~%" system-types)(format t "Current type: ~A~%" system-type)(format t "Current target: ~A~%" target-file)(format t "~%Instructions: (run from top nyquist directory)~%")(format t "Choose a system from the list above by typing:~%")(format t "\t(setf system-type '<a system type>)~%")(format t "Override the executable name or location by:~%")(format t "\t(setf target-file \"unix-path-name/ny\")~%")(format t "To build the Makefile, type:~%")(format t "\t(makefile)~%")(format t "To make Makefiles for all system types, type:~%")(format t "\t(makeall)~%");(format t "To build the Makesrc file, type:~%");(format t "\t(makesrc)~%");(format t;"Note: Makesrc is used to update sources from other directories.; It isn't necessary if you got the sources from the normal; .tar file release of Nyquist;")(setf xlfiles '("extern" "xldmem" "xlbfun" "xlcont" "xldbug" "xleval" "xlfio" "xlftab" "xlglob" "xlimage" "xlinit" "xlio" "xlisp" "xljump" "xllist" "xlmath" "xlobj" "xlpp" "xlprin" "xlread" "xlstr" "xlsubr" "xlsym" "xlsys"))(setf xlfiles-h '("osdefs" "osptrs" "xldmem" "xlisp" "extern"))(setf xlfiles-lsp '("xlinit" "misc" "evalenv" "printrec"))(setf nyqfiles '("debug" "falloc" "add" "local" "downsample" "handlers" "multiread" "multiseq" "samples" "seqext" "seqinterf" "sndread" "sndseq" "sndwrite" "sndmax" "sound" "stats" "compose" "inverse" "resamp" "resampv" "ffilterkit" "avg" "fft" "sndfail"))(setf fftfiles '("fftn")); note: audio<sys> and snd<sys> will be prepended to this list, e.g.; the strings "audiooss" and "sndlinux" will be added for linux systems;(defun init-sndfiles () (setf sndfiles '("ieeecvt" "snd" "sndcvt" "sndio" "sndheader")) (setf sndfiles-lsp '("snd")))(init-sndfiles)(setf depends-exceptions '( ("nyqsrc/handlers" "") ("nyqsrc/sndfail" "") ("nyqsrc/local" "xlisp/xlisp.h nyqsrc/sound.h") ("nyqsrc/stats" "nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h") ("snd/sndcvt" "snd/snd.h") ("snd/sndio" "snd/snd.h") ("snd/audiors6k" "snd/snd.h") ("snd/audionext" "snd/snd.h") ("snd/audiosgi" "snd/snd.h") ("snd/audiopmax" "snd/snd.h") ("snd/audiosparc" "snd/snd.h") ("snd/audiolinux" "snd/snd.h") ("snd/audiooss" "snd/snd.h") ("nyqsrc/sndfnint" "") ; sparc needs explicit rule for sndfnint.o ("nyqsrc/seqfnint" "") ; ditto for seqfnint.o))(setf nyqfiles-lsp '("init" "nyquist" "seqmidi" "seq" "makefile" "update" "transfiles" "examples" "nyinit"))(setf system-types-as-strings (mapcar #'string-downcase (mapcar #'symbol-name system-types)))(setf nyqfiles-lsp (append nyqfiles-lsp system-types-as-strings))(setf nyqfiles-h '("localdefs" "localptrs" "seqdecls" "cque" "switches"))(setf intfiles '("sndfnint" "seqfnint"))(setf extrafiles nil);(dolist (m system-types); (push (strcat "Makefile." ; (string-downcase (symbol-name m))); extrafiles))(push "export" extrafiles)(push "README" extrafiles)(push "howtorelease.doc" extrafiles)(setf cmtfiles '("cext" "cleanup" "cmdline" "cmtcmd" "moxc" "mem" "midifile" "midifns" "record" "seq" "seqmread" "seqmwrite" "seqread" "seqwrite" "tempomap" "timebase" "userio")) ; "midimgr" - removed by RBD(setf cmtfiles-h '("mfmidi" "midicode" "midierr" "musiprog" "pitch" "swlogic" "hash" "hashrout" "io" "midibuff"));; MAKEALL - makes all makefiles and copies them to nyqsrc;; ;; run this in nyquist/src;; (defun makeall (); (makesrc); (system "cp -p Makesrc nyqsrc") (dolist (m system-types) (setf system-type m) (setf m (string-downcase (symbol-name m))) (init-sndfiles) (makefile)));; MAKE-AUDIO-NAME -- (strcat "audio" system-name)(defun make-audio-name (system-name) (cond ((eq system-type 'linux) "audiooss") (t (strcat "audio" system-name))));; MAKE-SND-NAME -- (strcat "audio" system-name)(defun make-snd-name (system-name) (strcat "snd" system-name));; MAKEFILE - creates a Makefile from a list of sources;;;; reads sources from nyqfiles.txt(defun makefile () (let (system-name outf outf-name) (load "misc/transfiles.lsp") ; just to make sure we're current (while (null system-type) (format t "Write Makefile for what system? One of:~A~%" system-types) (setf system-type (read)) (cond ((not (member system-type system-types)) (format t "Unknown system type.~%") (setf system-type nil)))) (setf system-name (string-downcase (symbol-name system-type))) (setf outf-name (strcat "sys/unix/" system-name "/Makefile")) (format t "Opening for output: ~A\n" outf-name) (setf outf (open outf-name :direction :output)) (setf sndfiles (cons (make-audio-name system-name) (cons (make-snd-name system-name) sndfiles))) (format outf "## Makefile for Nyquist, SYSTEM-TYPE is ~A# run make in the top-level Nyquist directory to compile Nyquist## NOTE: this file is machine-generated. DO NOT EDIT!# Instead, modify makefile.lsp and regenerate the makefile.# Ports and bug fixes are welcome - please mail them to # dannenberg@cs.cmu.edu. Thanks.## This is the resulting executable (normally \"ny\"):NY = ~A# Standard list of includes (common to all unix versions)INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft# system dependent stuff for ~A:~AINTGEN = misc/intgen# Object files for Nyquist:" system-type target-file system-name (system-defs));;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (object-files outf) (format outf "# Sound functions to add to xlisp~%") (nyqheaders outf) (cmtheaders outf);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (format outf "EVERYTHING = $(NY) runtime/system.lspCURRENT = $(EVERYTHING)current: $(CURRENT)$(NY): $(OBJECTS)\t$(LN) $(OBJECTS) $(LFLAGS) -o $(NY)# copy appropriate system.lsp and make it read-only;# changes should be made to sys/unix/<system>/system.lspruntime/system.lsp: sys/unix/~A/system.lsp\tchmod +w runtime/system.lsp\tcp -p sys/unix/~A/system.lsp runtime/system.lsp\tchmod -w runtime/system.lsp" system-name system-name);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (dependencies outf system-name) (format outf (system-rules));;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (format outf "misc/intgen: misc/intgen.c\tcd misc; make intgenmisc/unpacker: misc/unpacker.c misc/convert.c\tcd misc; make unpackermisc/packer: misc/packer.c misc/convert.c\tcd misc; make packernyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen\t$(INTGEN) nyqsrc/sndfnint $(NYQHDRS)nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen\t$(INTGEN) nyqsrc/seqfnint $(CMTHDRS)clean:\tcd misc; make clean\trm -f $(OBJECTS)# Note that these files are machine-generated:\trm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h\trm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.hcleaner: clean\tcd misc; make cleaner\trm -f *.backup */*.backup\trm -f *~~ */*.*~~\trm -f *.save */*.save\trm -f *.CKP */*.CKP\trm -f *.BAK */*.BAK\trm -f *.old */*.old\trm -f *.gold */*.gold\trm -f playparms\trm -f points.dat") (cond ((eq system-type 'rs6k) (format outf "tar: cleaner\tsh -v sys/unix/cmu/tar.scriptbackup: cleaner\tsh -v sys/unix/cmu/backup.script"))) (close outf) ));; system-defs looks for a string of system-dependent defs for the makefile;;(defun system-defs () (system-var "-DEFS"));; system-rules looks for a string of system-dependent rules for the makefile;;(defun system-rules () (system-var "-RULES"));; system-var returns a string stored in the variable (if any):;; <system-type>-<suffix>;;(defun system-var (suffix) (let ((v (intern (strcat (symbol-name system-type) suffix)))) (cond ((boundp v) (symbol-value v)) (t ""))));; object-files - writes names of all object files for linking;;(defun object-files (outf) (let ((flist (append (add-prefix "xlisp/" xlfiles) (add-prefix "tran/" transfiles) (add-prefix "cmt/" cmtfiles) (add-prefix "nyqsrc/" nyqfiles)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -