Makefile
changeset 518 576a7e0fd9e0
parent 386 3efe37437745
child 536 14583eae4848
equal deleted inserted replaced
517:6889ad2dbd35 518:576a7e0fd9e0
     1 # Copyright (C) 2008-2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
     1 # Copyright (C) 2008-2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
     2 #
     2 #
     3 # You can do anything with this file without any warranty.
     3 # You can do anything with this file without any warranty.
       
     4 
       
     5 ################################################################
       
     6 # Helper definition.
       
     7 
       
     8 which = $(firstword $(foreach item,$(subst :, ,$(PATH)),$(wildcard $(item)/$1)))
       
     9 
       
    10 ################################################################
       
    11 # Platform/environment definition.
     4 
    12 
     5 ifeq '' '$(HOME)'
    13 ifeq '' '$(HOME)'
     6   $(error Home env var not set!)
    14   $(error Home env var not set!)
     7 endif
    15 endif
     8 
    16 
     9 host_os = unix
    17 host_os = unix
    10 ifneq '' '$(COMSPEC)'
    18 ifneq '' '$(COMSPEC)'
    11   host_os = windows
    19   host_os = windows
    12 endif
    20 endif
    13 
    21 
    14 # Special case for Windows if emacs-nox from Cygwin installed along with native Emacs.
       
    15 # So we run native Emacs to compile sources.
       
    16 EMACS = emacs
    22 EMACS = emacs
       
    23 # I prefer native Windows Emacs, so use it if available.
    17 ifeq 'windows' '$(host_os)'
    24 ifeq 'windows' '$(host_os)'
    18   EMACS = runemacs
    25   ifneq '' '$(call which,runemacs.exe)'
       
    26     EMACS = runemacs
       
    27   endif
    19 endif
    28 endif
       
    29 
       
    30 ################################################################
       
    31 # Targets.
    20 
    32 
    21 FILES_MODE_EL := $(wildcard *-mode.el)
    33 FILES_MODE_EL := $(wildcard *-mode.el)
    22 
    34 
    23 .PHONY: all
    35 .PHONY: all
    24 all: install
    36 all: install