auto.conf 1.02 KB
Newer Older
Eric Coissac's avatar
Eric Coissac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#
# $Id: auto.conf 1825 2013-02-26 09:39:47Z viari $
#
# auto.conf
# auto configuration file using guess_port
#
# this file is included in Makefile
#

#
# default shell for gnu-make
#

SHELL = /bin/sh

#
# CFGDIR : location of config files = this file directory location
#
# CFGPRT : port name (as returned by guess_port)
#

# because builtin 'lastword' is missing in gnu-make 3.80

lastword = $(word $(words $1), $1)

CFGDIR := $(dir $(call lastword, $(MAKEFILE_LIST)))

CFGPRT := $(shell $(CFGDIR)guess_port)

# check if port is correctly defined

ifneq (1, $(words $(CFGPRT)))
  entry := $(call lastword, $(CFGPRT))
  $(error port is undefined - add entry for "$(entry)" in configuration file -)
endif

#
# PORTNAME : port name to use : default is CFGPRT but may be futher modified
#            by machine specific configuration

PORTNAME = $(CFGPRT)

#
# default configuration
# may be overriden by machine dependant definitions below
#

include $(CFGDIR)default.conf

#
# machine dependant definitions
#

include $(CFGDIR)ports/$(CFGPRT).conf