Function: vhdl-compile

vhdl-compile is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-compile)

Documentation

Compile current buffer using the VHDL compiler specified in vhdl-compiler.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-compile ()
  "Compile current buffer using the VHDL compiler specified in `vhdl-compiler'."
  (interactive)
  (vhdl-compile-init)
  (let* ((project (vhdl-aget vhdl-project-alist vhdl-project))
	 (compiler (or (vhdl-aget vhdl-compiler-alist vhdl-compiler)
		       (error "ERROR:  No such compiler: \"%s\"" vhdl-compiler)))
	 (command (nth 0 compiler))
	 (default-directory (vhdl-compile-directory))
	 (file-name (if vhdl-compile-absolute-path
			(buffer-file-name)
		      (file-relative-name (buffer-file-name))))
	 (options (vhdl-get-compile-options project compiler file-name))
	 compilation-process-setup-function)
    (unless (file-directory-p default-directory)
      (error "ERROR:  Compile directory does not exist: \"%s\"" default-directory))
    ;; put file name into quotes if it contains spaces
    (when (string-match " " file-name)
      (setq file-name (concat "\"" file-name "\"")))
    ;; print out file name if compiler does not
    (setq vhdl-compile-file-name (if vhdl-compile-absolute-path
				     (buffer-file-name)
				   (file-relative-name (buffer-file-name))))
    (when (and (= 0 (nth 1 (nth 10 compiler)))
	       (= 0 (nth 1 (nth 11 compiler))))
      (setq compilation-process-setup-function #'vhdl-compile-print-file-name))
    ;; run compilation
    (if options
	(when command
	  (compile (concat command " " options " " file-name
			   (unless (equal vhdl-compile-post-command "")
			     (concat " " vhdl-compile-post-command)))))
      (vhdl-warning "Your project settings tell me not to compile this file"))))