#!/usr/bin/make # help out emacs
#
# Top-level autosetup-filtered Makefile for libfossil. This particular
# build is for Unix platforms with GNU Make 3.81+.
all:
include config.make
ShakeNMake.CISH_SOURCES := $(wildcard *.c) $(wildcard $(SRC.DIR)/*.c)
# Subdir cleanup rules and deps list must come before shakenmake.make is included
# or they must be set up manually afterwards...
clean-.: clean-th1ish clean-f-apps clean-cpp clean-s2
distclean-.: distclean-th1ish distclean-f-apps distclean-cpp distclean-s2
include shakenmake.make
MAIN_MAKEFILES := $(PACKAGE.MAKEFILE) $(ShakeNMake.MAKEFILE) @AUTODEPS@

AUTOCONFIG_H := @srcdir@/include/fossil-scm/autoconfig.h
#SRCDIR := @top_srcdir@/src
SRCDIR := @srcdir@/src

define CALL.SUBDIR
endef
SUBDIRS := src
$(eval $(call ShakeNMake.CALL.SUBDIRS,$(SUBDIRS)))
#$(eval $(call ShakeNMake.CALL.SUBDIR,src))
all: subdir-src


ifeq (1,@LIBFOSSIL_STATIC@)
  THELIB.LIB := libfossil$(ShakeNMake.EXTENSIONS.LIB)
else
  THELIB.LIB :=
endif
ifeq (1,@LIBFOSSIL_SHARED@)
  THELIB.DLL := libfossil$(ShakeNMake.EXTENSIONS.DLL)
else
  THELIB.DLL :=
endif

ifneq (,$(THELIB.DLL)$(THELIB.LIB))
src/$(THELIB.DLL):
	$(MAKE) -C src
src/$(THELIB.LIB):
	$(MAKE) -C src
$(THELIB.DLL): src/$(THELIB.DLL)
	ln -sf src/$(THELIB.DLL) .
$(THELIB.LIB): src/$(THELIB.LIB)
	ln -sf src/$(THELIB.LIB) .
all: $(THELIB.DLL) $(THELIB.LIB)
CLEAN_FILES += $(wildcard libfossil.so libfossil.dll libfossil.a)
endif


########################################################################
# Other stuff...

install: all
	@echo 'No installation rules yet.'

DISTCLEAN_FILES += $(AUTOCONFIG_H) Makefile config.log autosetup/jimsh0

# automake compatibility. do nothing for all these targets
#EMPTY_AUTOMAKE_TARGETS := dvi pdf ps info html tags ctags mostlyclean maintainer-clean check installcheck installdirs \
# install-pdf install-ps install-info install-html -install-dvi uninstall install-exec install-data distdir
#.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
#$(EMPTY_AUTOMAKE_TARGETS):

## @top_srcdir@/Makefile.in: # b/c AUTODEPS contains this name (it probably shouldn't)
#$(FSL.OBJ): @AUTODEPS@ @top_srcdir@/Makefile @top_srcdir@/config.make

# Reconfigure if needed
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
@top_srcdir@/config.make: @AUTODEPS@ @top_srcdir@/config.make.in
	@@AUTOREMAKE@
@top_srcdir@/Makefile: @AUTODEPS@ @top_srcdir@/Makefile.in
	chmod +w $@
	@@AUTOREMAKE@
@top_srcdir@/vars.make: @AUTODEPS@ @top_srcdir@/vars.make.in
	@@AUTOREMAKE@
endif

# Or on demand
reconfig:
	@AUTOREMAKE@

