config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

Makefile (2445B)


      1 .SUFFIXES:	# we don't need default suffix rules
      2 ifeq ($(MAKELEVEL), 0)
      3   $(error This make needs to be started as a sub-make from the toplevel directory.)
      4 endif
      5 
      6 LISPV 	:= org-version.el
      7 LISPI 	:= org-loaddefs.el
      8 LISPA 	:= $(LISPV) $(LISPI)
      9 LISPB 	:= $(LISPA:%el=%elc) org-install.elc
     10 LISPF 	:= $(filter-out $(LISPA),$(sort $(wildcard *.el)))
     11 LISPC 	:= $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
     12 LISPN 	:= $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln))
     13 _ORGCM_ := dirall single native source slint1 slint2
     14 -include local.mk
     15 
     16 .PHONY:	all compile compile-dirty \
     17 	$(_ORGCM_) $(_ORGCM_:%=compile-%) \
     18 	autoloads \
     19 	install clean cleanauto cleanall cleanelc clean-install
     20 
     21 # do not clean here, done in toplevel make
     22 all compile compile-dirty::	 | autoloads
     23 ifeq ($(filter-out $(_ORGCM_),$(ORGCM)),)
     24 	$(MAKE) compile-$(ORGCM)
     25 else
     26 	$(error ORGCM has illegal value $(ORGCM) (valid: $(_ORGCM_)))
     27 endif
     28 
     29 compile-dirall:	dirall
     30 compile-single: $(LISPC) | single
     31 compile-native: $(LISPN) | native
     32 compile-source:	| source dirall
     33 compile-slint1:	| dirall slint1
     34 compile-slint2:	| source dirall slint1
     35 
     36 # internal
     37 dirall:
     38 	@$(info ==================== $@ ====================)
     39 	@$(ELCDIR)
     40 single:
     41 	@$(info ==================== $@ ====================)
     42 native:
     43 	@$(info ==================== $@ ====================)
     44 source: cleanelc
     45 	@$(info ==================== $@ ====================)
     46 	@$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
     47 slint1:
     48 	@$(info ==================== $@ ====================)
     49 	@$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
     50 
     51 %.elc:	%.el
     52 	@$(info Compiling single $(abspath $<)...)
     53 	-@$(ELC) $<
     54 
     55 %.eln: %.el
     56 	@$(info Native compiling single $(abspath $<)...)
     57 	-@$(ELN) $<
     58 
     59 autoloads:	cleanauto $(LISPI) $(LISPV)
     60 
     61 $(LISPV):	$(LISPF)
     62 	@echo "org-version: $(ORGVERSION) ($(GITVERSION))"
     63 	@$(RM) $(@)
     64 	@$(MAKE_ORG_VERSION)
     65 
     66 $(LISPI):	$(LISPV) $(LISPF)
     67 	@echo "org-loaddefs: $(ORGVERSION) ($(GITVERSION))"
     68 	@$(RM) $(@)
     69 	@$(MAKE_ORG_INSTALL)
     70 
     71 install:	 compile $(LISPF)
     72 	if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
     73 	  $(MKDIR) $(DESTDIR)$(lispdir) ; \
     74 	fi ;
     75 	$(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
     76 
     77 cleanauto clean cleanall::
     78 	$(RM) $(LISPA) $(LISPB)
     79 clean cleanall cleanelc::
     80 	$(RM) *.elc
     81 
     82 clean-install:
     83 	if [ -d $(DESTDIR)$(lispdir) ] ; then \
     84 	  $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* $(DESTDIR)$(lispdir)/ol*.el* $(DESTDIR)$(lispdir)/ox*.el* ; \
     85 	fi ;