Makefile 4.43 KB
Newer Older
1 2 3
-include ../config.mk
include ../default.mk

4 5
## ###################################################################

6 7 8 9
.PHONY: magit-version.el install

all: lisp

10 11
## Build order #######################################################

12
git-commit.elc:
13 14 15
magit-utils.elc:
magit-section.elc:	magit-utils.elc
magit-git.elc:		magit-utils.elc magit-section.elc
16
magit-mode.elc:		magit-section.elc magit-git.elc
17
magit-margin.elc:	magit-section.elc magit-mode.elc
18
magit-process.elc:	magit-utils.elc magit-section.elc \
19
			magit-git.elc magit-mode.elc
20
magit-autorevert.elc:	magit-git.elc magit-process.elc
21
magit-core.elc:		magit-margin.elc magit-utils.elc \
22 23
			magit-section.elc magit-git.elc magit-mode.elc \
			magit-process.elc magit-autorevert.elc
24 25
magit-diff.elc:		git-commit.elc magit-core.elc
magit-log.elc:		magit-core.elc magit-diff.elc
26 27
magit-wip.elc:		magit-core.elc magit-log.elc
magit-apply.elc:	magit-core.elc magit-diff.elc magit-wip.elc
28
magit-repos.elc:	magit-core.elc
29
magit.elc:		git-commit.elc magit-core.elc magit-diff.elc \
30
			magit-log.elc magit-apply.elc magit-repos.elc
31
magit-status.elc:	magit.elc
32
magit-refs.elc: 	magit.elc
33
magit-files.elc:	magit.elc
34
magit-collab.elc:	magit.elc
35 36 37 38
magit-reset.elc:        magit.elc
magit-branch.elc:	magit.elc magit-collab.elc magit-reset.elc
magit-merge.elc:        magit.elc
magit-tag.elc:          magit.elc
39
magit-worktree.elc:	magit.elc
40
magit-notes.elc:	magit.elc
41 42 43
magit-sequence.elc:	magit.elc
magit-commit.elc:	magit.elc magit-sequence.elc
magit-remote.elc:	magit.elc
44 45 46 47
magit-clone.elc:	magit.elc
magit-fetch.elc:	magit.elc
magit-pull.elc:		magit.elc
magit-push.elc:		magit.elc
48
magit-patch.elc:	magit.elc
49 50 51
magit-bisect.elc:	magit.elc
magit-stash.elc:	magit.elc
magit-blame.elc:	magit.elc
52
magit-obsolete.elc:	magit.elc
53
magit-submodule.elc:	magit.elc
54
magit-subtree.elc:	magit.elc
55
magit-ediff.elc:	magit.elc
56
magit-gitignore.elc:	magit.elc
57
magit-extras.elc:	magit.elc magit-merge.elc
58
git-rebase.elc:		magit.elc
59
magit-imenu.elc:	magit.elc git-rebase.elc
Yuri Khan's avatar
Yuri Khan committed
60
magit-bookmark.elc:	magit.elc
61
magit-obsolete.elc:	magit.elc
62

63 64
## Build #############################################################

65
lisp:       $(ELCS) loaddefs
66 67
loaddefs:   $(PKG)-autoloads.el
versionlib: $(PKG)-version.el
68 69 70 71 72 73 74

%.elc: %.el
	@printf "Compiling $<\n"
	@$(BATCH) --eval "(progn\
	(when (file-exists-p \"$@\")\
	  (delete-file \"$@\"))\
	(setq with-editor-emacsclient-executable nil)\
75
	$$suppress_warnings)" \
76 77
	-f batch-byte-compile $<

78
$(PKG)-autoloads.el: $(ELS)
79
	@printf "Generating $@\n"
80
	@printf "%s" "$$LOADDEFS_TMPL" > $@
81
	@$(BATCH) --eval "(progn\
82 83 84 85
	(fset 'message (lambda (&rest _)))\
	(setq make-backup-files nil)\
	(setq vc-handled-backends nil)\
	(setq default-directory (file-truename default-directory))\
86
	(setq generated-autoload-file (expand-file-name \"$@\"))\
87
	(setq find-file-visit-truename t)\
88
	(update-directory-autoloads default-directory))"
89 90 91

$(PKG)-version.el:
	@printf "Generating $@\n"
92
	@printf "%s" "$$VERSIONLIB_TMPL" > $@
93

94 95
## Install ###########################################################

96
install: lisp versionlib
97 98 99
	@$(MKDIR) $(DESTDIR)$(lispdir)
	$(CP) $(ELS) magit-autoloads.el magit-version.el $(ELCS) $(DESTDIR)$(lispdir)

100 101
## Clean #############################################################

102
clean:
103
	@printf "Cleaning lisp/*...\n"
104
	@$(RM) *.elc $(ELGS)
105

106 107
## Templates #########################################################

108 109 110 111 112 113 114 115 116 117 118 119 120
define LOADDEFS_TMPL
;;; $(PKG)-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name \
(or (file-name-directory #$$) (car load-path))))

;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; $(PKG)-autoloads.el ends here
121

122 123 124 125 126 127 128
endef
export LOADDEFS_TMPL
#'

define VERSIONLIB_TMPL
;;; $(PKG)-version.el --- the Magit version you are using

129
(setq $(PKG)-version "$(VERSION)")
130 131 132

(provide '$(PKG)-version)

133 134 135 136 137 138
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
139
;;; $(PKG)-version.el ends here
140

141 142 143
endef
export VERSIONLIB_TMPL
#'
144 145 146 147 148 149 150 151 152 153 154 155

define suppress_warnings
(fset 'original-message (symbol-function 'message))
(fset 'message ;'
      (lambda (f &rest a)
        (unless (or (equal f "Wrote %s")
                    (equal f "pcase-memoize: equal first branch, yet different")
                    (and (equal f "Warning: Unknown defun property `%S' in %S")
                         (memq (car a) '(pure side-effect-free interactive-only))))
          (apply 'original-message f a))))
endef
export suppress_warnings