doomemacs/Makefile
Henrik Lissner 0425724571
Major rewrite of doom module API
+ Fix #446, where the .local/packages.el cache was generated with
  a faulty load-path.
+ Entries in the doom-modules hash table are now plists, containing
  :flags and :path, at least.
+ Add doom-initialize-modules for loading module config.el files.
+ Add doom-module-get for accessing this plist, e.g.

    (doom-module-get :some module)         ; returns plist
    (doom-module-get :some module :flags)  ; return specific property

+ Replace doom-module-enable with doom-module-set, e.g.

    (doom-module-set :some module :flags '(+a +b +c))

+ Remove doom-module-flags (use doom-module-get instead)
+ Rename doom-module-enabled-p with doom-module-p
+ Replace doom-module-path with doom-module-find-path and
  doom-module-expand-file. The former will search for an existing module
  or file in doom-modules-dirs. The latter will expand the path from
  whatever path is stored in doom-modules.
+ Replace doom-module-paths with doom-module-load-path
+ Changed doom! to allow for nested doom! calls by delaying the loading
  of module config.el files until as late as possible.
+ Refactor doom-initialize-packages to only ihitialize package state
  (i.e. doom-packages, package-alist, and quelpa-cache), rather than its
  previous behavior of loading all Doom files (and sometimes all module
  files). This is faster and more predictable.
2018-03-02 19:14:45 -05:00

94 lines
2.1 KiB
Makefile

# Ensure emacs always runs from this makefile's PWD
EMACS_FLAGS=--eval '(setq user-emacs-directory default-directory)' -l init.el
EMACS=emacs --quick --batch $(EMACS_FLAGS)
EMACSI=emacs -q $(EMACS_FLAGS)
MODULES=$(patsubst modules/%/, %, $(sort $(dir $(wildcard modules/*/ modules/*/*/))))
all: autoloads autoremove install
## Shortcuts
a: autoloads
i: install
u: update
r: autoremove
c: compile
cc: compile-core
ce: compile-elpa
## Package management
install: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-install
update: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-update
autoremove: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-autoremove
autoloads: init.el
@$(EMACS) -f doom//reload-autoloads
## Byte compilation
# compile
# compile-core
# compile-module
# compile-module/submodule
compile: init.el clean
@$(EMACS) -f doom//byte-compile
compile-core: init.el clean
@$(EMACS) -f doom//byte-compile-core
compile-elpa: init.el
@$(EMACS) -f doom//byte-recompile-plugins
$(patsubst %, compile-%, $(MODULES)): init.el .local/autoloads.el
@$(EMACS) -f doom//byte-compile -- $(patsubst compile-%, %, $@)
recompile: init.el
@$(EMACS) -f doom//byte-compile -- -r
clean:
@$(EMACS) -f doom//clean-byte-compiled-files
## Unit tests
# test
# test-core
# test-module
# test-module/submodule
test: init.el .local/autoloads.el
@$(EMACS) -f doom//run-tests
test-core $(patsubst %, test-%, $(MODULES)): init.el .local/autoloads.el
@$(EMACS) -f doom//run-tests -- $(subst test-, , $@)
# run tests interactively
testi: init.el .local/autoloads.el
@$(EMACSI) -f doom//run-tests
## Utility tasks
# Runs Emacs from a different folder than ~/.emacs.d; only use this for testing!
run:
@$(EMACSI) --eval "(run-hooks 'after-init-hook 'emacs-startup-hook 'window-setup-hook)"
# Diagnoses potential OS/environment issues
doctor:
@bin/doom-doctor
# Prints debug info about your current setup
info:
@$(EMACS) -l core/autoload/debug.el -f doom/info
## Internal tasks
init.el:
@$(error No init.el file; create one or copy init.example.el)
.local/autoloads.el:
@$(EMACS) -f doom-initialize-autoloads
.PHONY: all compile test testi clean