# Top-level Makefile for Agda 2 # Author: Ulf Norell ## Includes ############################################################### TOP = . is_configured = $(shell if test -f mk/config.mk; \ then echo Yes; \ else echo No; \ fi \ ) include mk/paths.mk ifeq ($(is_configured),Yes) include mk/config.mk include mk/rules.mk endif ## Phony targets ########################################################## .PHONY : default all clean install full prof core \ debug doc dist make_configure clean_test examples ## Default target ######################################################### ifeq ($(is_configured),Yes) default : full core transl tags else default : make_configure endif ## Making the make system ################################################# m4_macros = $(wildcard $(MACRO_DIR)/*.m4) make_configure : configure @echo "Run './configure' to set up the build system." configure : aclocal.m4 $(m4_macros) configure.ac autoconf ## ## The following targets are only available after running configure ####### ## ifeq ($(is_configured),Yes) ## Making the documentation ############################################### doc : $(MAKE) -C $(HADDOCK_DIR) ## Making the full language ############################################### ifeq ($(HAVE_RUNHASKELL),Yes) SETUP = Setup.hs RUNSETUP = $(RUNHASKELL) $(SETUP) else SETUP = setup RUNSETUP = ./setup $(SETUP) : Setup.hs ghc --make -o $@ $< endif full : $(SETUP) $(MAIN_SETUP) $(RUNSETUP) build $(RUNSETUP) register --user --inplace $(MAKE) -C $(MAIN_SRC_DIR) # $(MAKE) -C $(FULL_SRC_DIR) prof : $(MAKE) -C $(FULL_SRC_DIR) prof ## Making the core language ############################################### core : $(MAKE) -C $(CORE_SRC_DIR) ## Making the Agda 1 to Agda 2 translator ################################# transl : $(MAKE) -C $(TRANSL_SRC_DIR) ## Making the source distribution ######################################### ifeq ($(HAVE_DARCS)-$(shell if test -d _darcs; then echo darcs; fi),Yes-darcs) is_darcs_repo = Yes else is_darcs_repo = No endif ifeq ($(is_darcs_repo),Yes) dist : agda2.tar.gz agda2.tar.gz : $(DARCS) dist -d agda2 else dist : @echo You can only "'make dist'" from the darcs repository. @$(FALSE) endif ifeq ($(HAVE_HASKTAGS),Yes) tags : $(MAKE) -C $(FULL_SRC_DIR) tags else tags : @true endif ## Testing ########################################################### test : succeed examples fail succeed : @echo "======================================================================" @echo "===================== Suite of successfull tests =====================" @echo "======================================================================" @$(MAKE) -C test/succeed examples : @echo "======================================================================" @echo "========================= Suite of examples ==========================" @echo "======================================================================" @$(MAKE) -C examples fail : @echo "======================================================================" @echo "======================= Suite of failing tests =======================" @echo "======================================================================" @$(MAKE) -C test/fail ## Clean ################################################################## clean : $(MAKE) -C $(HADDOCK_DIR) clean rm -rf $(OUT_DIR) veryclean : $(MAKE) -C $(HADDOCK_DIR) veryclean rm -rf $(OUT_DIR) rm -rf configure config.log config.status autom4te.cache mk/config.mk ## Debugging the Makefile ################################################# info : @echo "Do we have ghc 6.4? $(HAVE_GHC_6_4)" @echo "Is this the darcs repository? $(is_darcs_repo)" else # is_configured info : @echo "You haven't run configure." endif # is_configured