#
# libLensFun makefile
# Requirements: GNU Make >=3.80
#

-include config.mak
# Local user file which can be used to override some of the settings (e.g. MODE)
-include local-config.mak

ifndef TARGET
$(error You must run configure before starting compiling)
endif

# Default include directories
DIR.INCLUDE.C = include

# Default build mode
MODE ?= release

# We want to always build dependencies (no need for "make dep")
# if we're going to build any of the libraries, tools, apps or tests,
# but only if the 'out/blah/' directory has been created
WANTDEPS = $(strip $(foreach g,$(MAKECMDGOALS), \
    $(findstring $(SPACE)$g$(SPACE), all apps libs tools tests \
    $(APPS) $(LIBS) $(TOOLS) $(TESTS) )))
AUTODEP ?= $(if $(wildcard $(OUT)),$(if $(WANTDEPS),1))

# Extra files to include in distribution
DISTEXTRA += include/ build/ README tibs.py
# Allow to clean autogenerated files
GENFILES += tibs.pyc

# Build tools if they aren't available
ifndef MAKEDEP
MAKEDEP = $(OUT)makedep$(EXE)
MAKEDEP_DEP = $(MAKEDEP)
endif

DIR.TIBS = build/tibs
include $(DIR.TIBS)/rules.mak
