Login
Changes On Branch 345150d88e676df6
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch toplevel-make Excluding Merge-Ins

This is equivalent to a diff from e33e6441c8 to 345150d88e

2021-12-21
06:58
Overhauled the build system to use (for the most part) a single top-level makefile, with each significant subdir in its own sub-makefile. This improves parallel buildability tremendously but doesn't gain much speed on a 4-core intel i3-based system. The doc/ and bindings/s2 dirs still use the older makefiles for the time being. check-in: 5c7c8ba69e user: stephan tags: trunk
06:54
Minor cleanups in the top-level makefile in prep for merge to trunk. Closed-Leaf check-in: 345150d88e user: stephan tags: toplevel-make
06:23
Renamed doc/Makefile to doc/GNUmakefile. check-in: 8abd9a209c user: stephan tags: toplevel-make
2021-12-20
22:07
Cherrypick [3987b62a030d] using f-merge. check-in: c2a2e453da user: stephan tags: trunk
09:41
Initial work on experimentally moving the subdir makes into a single top-level mega-makefile. check-in: 1542e54763 user: stephan tags: toplevel-make
09:24
Build file typo. check-in: e33e6441c8 user: stephan tags: trunk
2021-12-17
18:35
Minor constness tweaks. Added a note about how fsl_repo_rebuild() handles corruption such as that reported at [https://fossil-scm.org/forum/forumpost/f4cc31863179f843]. Removed a completed TODO comment. check-in: 9886240dfc user: stephan tags: trunk

Changes to .fossil-settings/ignore-glob.
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
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







-
+
+



-


-






+



+

+







*.res
*.sl
*.so
*~
*.vg
*.massif
*._out
Makefile
GNUmakefile
make-*.make
autosetup/jimsh0
config.log
config.make
bindings/cpp/Makefile
bindings/cpp/test
doc/Doxyfile
f-apps/Makefile
f-apps/zipped.zip
f-apps/f-acat
f-apps/f-add
f-apps/f-adiff
f-apps/f-annotate
f-apps/f-checkin
f-apps/f-ciwoco
f-apps/f-config
f-apps/f-delta
f-apps/f-event
f-apps/f-extract
f-apps/f-ls
f-apps/f-merge
f-apps/f-mfparse
f-apps/f-new
f-apps/f-parseparty
f-apps/f-query
f-apps/f-resolve
f-apps/f-rm
f-apps/f-sanity
49
50
51
52
53
54
55
56
57
58
59
60
61
51
52
53
54
55
56
57

58
59
60
61
62







-





f-apps/f-test-ciwoco
f-apps/f-test-diff-builder
f-apps/f-test-line-diff
f-apps/f-test-merge3
f-apps/f-test-merge
f-apps/f-test-reserved-name-check
include/fossil-scm/autoconfig.h
src/Makefile
tools/text2c
bindings/s2/f-s2sh
*/tmp/*
doc/libfossil-API-html/*
compile_commands*
Added GNUmakefile.in.





































































































































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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/usr/bin/make # help out emacs
#
# Top-level autosetup-filtered Makefile for libfossil. This particular
# build is for Unix platforms with GNU Make 4+.
all:
ROOT.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
DISTCLEAN.root += $(ROOT.MAKEFILE)
TOP_DIR := $(patsubst %/,%,$(dir $(ROOT.MAKEFILE)))

#ShakeNMake.CISH_SOURCES := $(wildcard *.c) $(wildcard $(SRC.DIR)/*.c)

########################################################################
# Some common vars used by shakenmake.make and/or the sub-makes
# (make-*.make).
DIR.top := @srcdir@
DIR.src := @srcdir@/src
DIR.client := @srcdir@/client
DIR.tools := @srcdir@/tools
DIR.include := @srcdir@/include
DIR.bindings := @srcdir@/bindings
DIR.f-apps := @srcdir@/f-apps
ShakeNMake.CISH_SOURCES := $(wildcard \
  $(DIR.src)/*.[ch] \
  $(DIR.f-apps)/*.[ch] \
  $(DIR.client)/fnc/*.[ch] \
  $(DIR.bindings)/cpp/*.[ch]pp \
  $(DIR.tools)/*.[ch] \
  $(DIR.include)/fossil-scm/*.{h,hpp} \
)
include config.make
include shakenmake.make

########################################################################
# Subdir/module builds...
#
# Maintenance reminders: all relevant symbols in the sub-makefiles
# (make-XXX.make) MUST be unique across the whole global
# namespace. Similarly, all relevant paths must point to that
# subdir. That is particularly of interest with the BIN/DLL/LIB and
# CLEAN.xxx rules, which may require another level of $(var)
# indirection for that purpose. It's also important when using
# CPPFLAGS and such, to keep subdir-specific flags from leaking across
# makefiles. Similarly, when using ShakeNMake.install.XXX, the vars
# must appended to instead of overwritten.
########################################################################
# INCLUDE_SINGLE_SUBMAKE includes file make-$(1).make if it exists,
# else this is a no-op. It protects against multiple inclusion.
INCLUDED_SUBMAKES :=
define INCLUDE_SINGLE_SUBMAKE
  SINGLE.$(1) := $$(wildcard make-$(1).make)
  ifneq (,$$(SINGLE.$(1)))
  ifneq ($(1),$$(strip $$(filter $(1),$$(INCLUDED_SUBMAKES))))
    $(1):# kludge
    ifneq (,$$(strip $$(filter distclean-$(1) clean-$(1),$(MAKECMDGOALS))))
      MAKING_CLEAN.$(1):=1
    endif
    INCLUDED_SUBMAKES+=$(1)
    $$(info Importing sub-make: $(1))
    include $$(SINGLE.$(1))
  endif
  endif
endef
# If passed an explicit make target matching make-XXX.make then
# include that makefile. Note that we must always include
# make-libf.make because all sub-makes depend on those bits.
$(eval $(call INCLUDE_SINGLE_SUBMAKE,libf))
ifneq (,$(MAKECMDGOALS))
  $(foreach f,$(MAKECMDGOALS),$(eval $(call INCLUDE_SINGLE_SUBMAKE,$(f))))
endif
INCLUDED_SUBMAKES:=$(strip $(INCLUDED_SUBMAKES))
#$(info INCLUDED_SUBMAKES=$(INCLUDED_SUBMAKES))
ifneq (libf-only,$(strip $(filter libf-only,$(INCLUDED_SUBMAKES))))
ifeq (libf,$(INCLUDED_SUBMAKES))
  # ^^^^ no submakes were explicitly called for, so include them all...
  themakes := f-apps
  ifeq (1,$(BUILD_CLIENT_FNC))
    themakes += client-fnc
  endif
  ifneq (,$(CXX))
    themakes += binding-cpp
  endif
  $(foreach f,$(themakes),$(eval $(call INCLUDE_SINGLE_SUBMAKE,$(f))))
  undefine themakes
  #$(info MAKEFILE_LIST=$(MAKEFILE_LIST))
endif
endif
undefine INCLUDED_SUBMAKES
undefine INCLUDE_SINGLE_SUBMAKE
# /subdir builds
########################################################################

$(call ShakeNMake.CALL.CLEAN-SET,root)
DISTCLEAN.root += config.make
# All GENERATED make-*.make files...
DISTCLEAN.root += make-libf.make \
  make-f-apps.make \
  make-client-fnc.make \
  make-binding-cpp


ifeq ($(MAKE_COMPILATION_DB),yes)
all: compile_commands.json
compile_commands.json:
	@$(RM) $@
	sed -e '1s/^/[\'$$'\n''/' -e '$$s/,$$/\'$$'\n'']/' $(compdb_dir)/*.o.json > $@+
	@if test -s $@+; then mv $@+ $@; else $(RM) $@+; fi
endif

AUTOCONFIG_H := $(DIR.include)/fossil-scm/autoconfig.h
DISTCLEAN.root += $(AUTOCONFIG_H) $(ROOT.MAKEFILE) config.log \
  autosetup/jimsh0 \
	$(wildcard compile_commands/*) compile_commands.json+

# 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@
#endif

# Or on demand
reconfig:
	@AUTOREMAKE@

CLEAN.root += $(wildcard $(DIR.top)/*~)
Changes to auto.def.
383
384
385
386
387
388
389
390
391
392
393
394





395
396
397


398
399
400
401
402
403
404
383
384
385
386
387
388
389





390
391
392
393
394



395
396
397
398
399
400
401
402
403







-
-
-
-
-
+
+
+
+
+
-
-
-
+
+







}

wh-bin-define install
wh-bin-define etags

# Each generated Makefile requires an input file with a .in extension:
wh-make-from-dot-in {
    config.make
    Makefile
    src/Makefile
    f-apps/Makefile
    bindings/Makefile
  config.make
  Makefile
  GNUmakefile
  make-libf.make
  make-f-apps.make
    bindings/cpp/Makefile
    client/Makefile
    client/fnc/Makefile
  make-client-fnc.make
  make-binding-cpp.make
}
wh-make-from-dot-in {
    doc/Doxyfile
} 1

if {0} {
    # Achtung: ordering of the -bare/-str options here is important
Added bindings/cpp/GNUmakefile.





1
2
3
4
5
+
+
+
+
+
all:
clean:
	$(MAKE) -C ../.. binding-cpp clean-binding-cpp
%:
	$(MAKE) -C ../.. binding-cpp $@
Deleted bindings/cpp/Makefile.in.
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124




























































































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
all:
include ../../subdir-inc.make
#$(error $(TOP_SRCDIR))
#CPPFLAGS += -I$(TOP_INCDIR)
#CPPFLAGS += -I$(TOP_SRCDIR)/include
CPPFLAGS += -I$(TOP_SRCDIR)/src# workaround for in-tree sqlite3.h
CXXFLAGS += -fPIC -Wall -Werror
DISTCLEAN_FILES += Makefile
#INCLUDES_PATH ?= $(HOME)/include /usr/local/include /usr/include

LIBFOSSIL.LDFLAGS := -L$(TOP_SRCDIR) -lfossil -lz

#ifeq (,$(strip $(filter distclean clean,$(MAKECMDGOALS))))
#$(LIBFOSSIL.LDFLAGS):
#	$(MAKE) -C ..
#endif

CPP.SRC := 	\
	Context.cpp \
	Db.cpp \
	Deck.cpp \
	Exception.cpp \
	Fossil.cpp \
	OStream.cpp

OBJECTS := $(patsubst %.cpp,%.o,$(CPP.SRC))

libfossil++.DLL.OBJECTS := $(OBJECTS)
libfossil++.BIN.LDFLAGS := -lstdc++ -fPIC $(LIBFOSSIL.LDFLAGS)# -lsqlite3 -lz
libfossil++.LIB.OBJECTS := $(libfossil++.DLL.OBJECTS)
Makefile: Makefile.in
$(libfossil++.DLL.OBJECTS): Makefile
########################################################################
# Shared lib
$(eval $(call ShakeNMake.CALL.RULES.DLLS,libfossil++))
all: $(libfossil++.DLL)
$(libfossil++.DLL): $(libfossil++.DLL.OBJECTS)
#Static lib (don't work well with _some_ C++ template uses)
#$(eval $(call ShakeNMake.CALL.RULES.LIBS,libfossil++))
#all: $(libfossil++.LIB)
#$(libfossil++.LIB): $(libfossil++.LIB.OBJECTS)

test.BIN.OBJECTS := test.o
ifeq (0,1)
test.BIN.LDFLAGS := $(LIBFOSSIL.LDFLAGS) $(EXTRA_LIBS) -lstdc++ -L. -lfossil++ @SH_LINKFLAGS@
else
test.BIN.OBJECTS += $(libfossil++.DLL.OBJECTS)
test.BIN.LDFLAGS := $(LIBFOSSIL.LDFLAGS) $(EXTRA_LIBS) -lstdc++ @SH_LINKFLAGS@
endif
$(eval $(call ShakeNMake.CALL.RULES.BINS,test))
all: $(test.BIN)


########################################################################
# A quick-n-dirty amalgamation build...
INCD := $(TOP_INCDIR)/fossil-scm
AMAL_D := $(TOP_SRCDIR_REL)
AMAL_C := $(AMAL_D)/libfossil.c
AMAL_H := $(AMAL_D)/libfossil.h
AMAL_CPP := $(AMAL_D)/libfossil++.cpp
AMAL_HPP := $(AMAL_D)/libfossil++.hpp
AMAL_CONF.H := $(AMAL_D)/libfossil-config.h
CLEAN_FILES += $(AMAL_HPP) $(AMAL_CPP)

AMAL_CPP.SRC := \
	$(CPP.SRC)

# ACHTUNG: in AMAL_H.SRC, $(AMAL_CONF.H) MUST be included first.
AMAL_HPP.SRC := \
	$(INCD)/fossil.hpp

$(AMAL_HPP.SRC):
$(AMAL_CPP.SRC):
$(AMAL_HPP): Makefile $(AMAL_HPP.SRC)
$(AMAL_CPP): Makefile $(AMAL_HPP) $(AMAL_CPP.SRC)
$(AMAL_CONF.H): $(MAIN_MAKEFILES)

$(AMAL_HPP):
	@echo "Creating $@..."
	@{ \
		echo '#if !defined(FSLPP_AMALGAMATION_BUILD)'; \
		echo '#define FSLPP_AMALGAMATION_BUILD 1'; \
		echo '#endif'; \
		echo '#include "$(notdir $(AMAL_H))"'; \
	} > $@
	@{ \
		for i in $(AMAL_HPP.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed  \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		 -e '/[ ]*#[ ]*include[ ]*.*".*config\.h[>"]/d' \
		>> $@

$(AMAL_CPP): $(AMAL_HPP)
	@echo "Creating $@..."
	@echo '#include "$(notdir $(AMAL_HPP))"' > $@
	@{ \
		for i in $(AMAL_CPP.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h.*[>"]/d' \
		>> $@

AMAL_CPP_FLAGS := -I$(TOP_INCDIR) -I$(TOP_SRCDIR_REL) -I. -I$(TOP_SRCDIR_REL)/src# for sqlite3.h :/
.PHONY: amal
amal: $(AMAL_CPP)
	@ls -ls $(AMAL_CPP) $(AMAL_HPP)
	@if which g++ >/dev/null; then \
		echo "Trying GCC..."; \
		g++ -c $(AMAL_CPP) -pedantic -Wstrict-aliasing -Wall -Werror -Wno-long-long $(AMAL_CPP_FLAGS); \
	fi; true
	@if which clang >/dev/null; then \
		echo "Trying clang..."; \
		clang -c $(AMAL_CPP) -pedantic -Wstrict-aliasing -Wall -Werror -Wno-long-long $(AMAL_CPP_FLAGS); \
	fi; true

# /amalgamation
########################################################################
Changes to bindings/cpp/OStream.cpp.
171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
171
172
173
174
175
176
177

178
179
180
181
182
183
184
185







-
+







  }

  FslOutputFStream::FslOutputFStream( fsl_output_f out, void * outState )
    : sb(new FslOutputFStreamBuf(out, outState, *this)){
  }

  int FslOutputFStream::fslAppendfF( void * state,
                                     void const * s, unsigned long n ){
                                     void const * s, fsl_size_t n ){
    FslOutputFStream * out = static_cast<FslOutputFStream*>(state);
    if(out->good()){
      out->write( (char const *)s, (std::streamsize)n );
      return out->good() ? 0 : -1;
    }else return -1;
  }

Changes to bindings/cpp/test.cpp.
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
105
106
107
108
109
110
111

112
113
114
115
116
117
118
119







-
+







    fsl_uuid_cstr uuid = NULL;
    fsl_id_t rid = 0;
    fsl_ckout_version_info(cx, &rid, &uuid);
    fout << "Checkout version: "<<rid << " ==> "<<uuid<<'\n';
  }

  char const * filename = 1
    ? __FILE__
    ? "test.cpp"
    : "/fail"
    ;
  std::ifstream is(filename);
  if(!is.good()){
    throw f::Exception(FSL_RC_IO,"Cannot open input file: %s",
                       filename);
  }
Deleted client/Makefile.in.
1
2
3
4
5
6
7
8
9
10
11











-
-
-
-
-
-
-
-
-
-
-
#!/usr/bin/make # help out emacs
all:
include ../subdir-inc.make
DISTCLEAN_FILES += Makefile
ifeq (1,$(BUILD_CLIENT_FNC))
clean-.: clean-fnc
distclean-.: distclean-fnc
SUBDIRS := fnc
$(eval $(call ShakeNMake.CALL.SUBDIRS,$(SUBDIRS)))
all: subdir-fnc
endif
Added client/fnc/GNUmakefile.





1
2
3
4
5
+
+
+
+
+
all:
clean:
	$(MAKE) -C ../.. client-fnc clean-client-fnc
%:
	$(MAKE) -C ../.. client-fnc $@
Deleted client/fnc/Makefile.in.
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







































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
all:
OBJ.DIR := .# KLUDGE for libfossil-specific hack in deps generator
include ../../subdir-inc.make
LIB_CURSES := @LIB_CURSES@
ifeq (,$(LIB_CURSES))
$(error Expecting LIB_CURSES to be set by the configure process.)
endif
CFLAGS_CURSES := @CFLAGS_CURSES@
CPPFLAGS += -I$(TOP_DIR)# libfossil.[ch]
CPPFLAGS += -I$(TOP_DIR)/src# in-tree sqlite3.h
CPPFLAGS += $(CFLAGS_CURSES)
DISTCLEAN_FILES += Makefile

########################################################################
# To build fnc, we need the curses and pthread libraries.
# -lz is for libfossil
# -liconv is for libfossil on macOS
# -lutil is... ???
# -lm is for sqlite3
FNC_LDFLAGS := $(LIBF_STATIC_CLIENT_LDFLAGS)
PLATFORM := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
ifneq ($(filter $(PLATFORM),Darwin),)
  FNC_LDFLAGS += -liconv
endif
FNC_LDFLAGS += $(LIB_CURSES) -lutil -lpthread
FNC_LDFLAGS += 

# This is needed for Mac builds, else they don't see the
# wide-char curses APIs:
CPPFLAGS += -D_XOPEN_SOURCE_EXTENDED

fnc.BIN.OBJECTS += fnc.o
fnc.BIN.LDFLAGS := $(FNC_LDFLAGS)
$(eval $(call ShakeNMake.CALL.RULES.BIN,fnc))
all: $(fnc.BIN)
$(fnc.BIN.OBJECTS): $(LIBF_STATIC_CLIENT_OBJ_DEPS)

ShakeNMake.install.bins := $(fnc.BIN)
ShakeNMake.install.man1 := fnc.1
Changes to config.make.in.
34
35
36
37
38
39
40
41

42
43
44
45
46
47


48
49
50
51
52
53
54
34
35
36
37
38
39
40

41
42
43
44
45
46

47
48
49
50
51
52
53
54
55







-
+





-
+
+








CONFIG.MAKE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
#TOP_SRCDIR_ABS := $(dir $(realpath $(CONFIG.MAKE)))
TOP_SRCDIR_REL := $(patsubst %/,%,$(dir $(CONFIG.MAKE)))
TOP_SRCDIR_ABS := $(realpath $(TOP_SRCDIR_REL))
#$(error TOP_SRCDIR_REL=$(TOP_SRCDIR_REL))

SRC.DIR := $(TOP_SRCDIR_REL)/src
DIR.src := $(TOP_SRCDIR_REL)/src

# Project-specific CFLAGS
TOP_INCDIR := $(TOP_SRCDIR_REL)/include
COMPAT_DIR := $(TOP_SRCDIR_REL)/compat
#CPPFLAGS += -D_GNU_SOURCE -Wall -Werror -I. -I$(TOP_INCDIR)
CPPFLAGS += -I. -I$(TOP_INCDIR) -I$(SRC.DIR)
CPPFLAGS += -I. -I$(TOP_INCDIR) -I$(DIR.src)
# ^^^ DIR.src is for in-tree sqlite3.h
# -I$(COMPAT_DIR)/javavm/export -I$(COMPAT_DIR)/tcl-8.6/generic
ifneq (,$(wildcard $(HOME)/include/*))
  # This is admittedly primarily for my own sake!
  CPPFLAGS += -I$(HOME)/include
endif

ifeq (,$(filter tcc,$(CC)))
Added doc/GNUmakefile.




























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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/usr/bin/make -f
all:
include ../subdir-inc.make

.NOTPARALLEL: # stop (make doc upload) from racing

OUT_PREFIX := libfossil-API-
clean-doxy:
	-rm -fr $(OUT_PREFIX)*

DISTCLEAN_FILES += Doxyfile
clean: clean-doxy

Doxyfile: Doxyfile.in
	@echo "ERROR: need to reconfigure to create Doxyfile!"; \
	exit 1

doc doxy: Doxyfile
	@echo "Generating API docs..."
	@doxygen
	@echo "Output is in: "; ls -1td $(OUT_PREFIX)*

all:
	@echo "Run 'make doc' to generate the API docs with doxygen."

upload:
	cd libfossil-API-html || exit $$?; \
	rsync -rzq -e ssh --delete . wh:www.f/doxygen/libfossil/
Deleted doc/Makefile.
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




























-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#!/usr/bin/make -f
all:
include ../subdir-inc.make

.NOTPARALLEL: # stop (make doc upload) from racing

OUT_PREFIX := libfossil-API-
clean-doxy:
	-rm -fr $(OUT_PREFIX)*

DISTCLEAN_FILES += Doxyfile
clean: clean-doxy

Doxyfile: Doxyfile.in
	@echo "ERROR: need to reconfigure to create Doxyfile!"; \
	exit 1

doc doxy: Doxyfile
	@echo "Generating API docs..."
	@doxygen
	@echo "Output is in: "; ls -1td $(OUT_PREFIX)*

all:
	@echo "Run 'make doc' to generate the API docs with doxygen."

upload:
	cd libfossil-API-html || exit $$?; \
	rsync -rzq -e ssh --delete . wh:www.f/doxygen/libfossil/
Added f-apps/Makefile.





1
2
3
4
5
+
+
+
+
+
all:
%:
	$(MAKE) -C .. f-apps $@
clean:
	$(MAKE) -C .. f-apps clean-f-apps
Deleted f-apps/Makefile.in.
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101





































































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
all:
OBJ.DIR := .# KLUDGE for libfossil-specific hack in deps generator
include ../subdir-inc.make
#$(error $(TOP_INCDIR))
#CPPFLAGS += -I$(TOP_INCDIR)
CPPFLAGS += -I$(TOP_DIR)/include
CPPFLAGS += -I$(TOP_DIR)/src# workaround for in-tree sqlite3.h
DISTCLEAN_FILES += Makefile

HAS_ADDED_LIBF_STATIC := 0
ifeq (,$(CC_PROFILE_FLAG))
  LIBFOSSIL.LDFLAGS := -L.. -L../src -lfossil
else
  # For profiling builds to report useful stuff we have to statically
  # link...
  LIBFOSSIL.LDFLAGS := $(LIBF_STATIC_CLIENT_LDFLAGS)
  HAS_ADDED_LIBF_STATIC := 1
endif

ifeq (0,@LIBFOSSIL_SHARED@)
  # In static build, we need some extra flags...
  LIBFOSSIL.LDFLAGS += $(LDFLAGS_MODULE_LOADER)
ifeq (0,$(HAS_ADDED_LIBF_STATIC))
  LIBFOSSIL.LDFLAGS += $(LIBF_STATIC_CLIENT_LDFLAGS)
endif
endif

TEST_BINS_LDFLAGS := $(LIBFOSSIL.LDFLAGS) $(EXTRA_LIBS) @SH_LINKFLAGS@

TEST_BINS_LIBDEPS := $(wildcard ../libfossil.*)
ifneq (,$($(TEST_BINS_LIBDEPS)))
ifeq (,$(strip $(filter distclean clean,$(MAKECMDGOALS))))
$(TEST_BINS_LIBDEPS):
	$(MAKE) -C ..
endif
endif

########################################################################
# Sets up binary build rules for binary named $1. This only works
# for the basic test binaries which all have common compile/link
# bits. Assumes sources are in $1.c.
define RULES_F_BIN
$(1).BIN.OBJECTS += $(1).o
$(1).BIN.LDFLAGS += $$(TEST_BINS_LDFLAGS)
$(call ShakeNMake.CALL.RULES.BIN,$(1))
$$($(1).BIN): $$(TEST_BINS_LIBDEPS)
all: $$($(1).BIN)
CLEAN_BINS += $$($(1).BIN)
ifneq (,$(CC_PROFILE_FLAG))
$$($(1).BIN.OBJECTS): $$(LIBF_STATIC_CLIENT_OBJ_DEPS)
endif
endef

ShakeNMake.install.bins := \
  f-acat \
  f-add \
  f-adiff \
  f-annotate \
  f-aparse \
  f-ci \
  f-ciwoco \
  f-co \
  f-config \
  f-delta \
  f-extract \
  f-ls \
  f-merge \
  f-new \
  f-open \
  f-parseparty \
  f-query \
  f-rebuild \
  f-repostat \
  f-resolve \
  f-revert \
  f-rm \
  f-status \
  f-tag \
  f-timeline \
  f-update \
  f-vdiff \
  f-wiki \
  f-zip

F_BINS := \
  $(ShakeNMake.install.bins) \
  f-event \
  f-sanity \
  f-sizeof \
  f-_scratchpad \
  f-_template \
  f-test-ciwoco \
  f-test-diff-builder \
  f-test-line-diff \
  f-test-merge3 \
  f-test-reserved-name-check \
  test

test.BIN.LDFLAGS += -lz

$(foreach fbin,$(F_BINS),$(eval $(call RULES_F_BIN,$(fbin))))
Changes to f-apps/f-ci.c.
60
61
62
63
64
65
66

67
68
69
70
71
72
73









74
75
76














77
78
79
80
81
82
83
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104







+







+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+







    case '+':
      ++t;
      /* fall through */
    default:
      ttype = FSL_TAGTYPE_ADD;
      break;
  }
#if 0
  if(0==fsl_strncmp("sym-",t, 4)){
    rc = fcli_err_set(FSL_RC_MISUSE,
                      "Do not set sym-XYZ tags (used for branching) "
                      "with the --tag flag: they will not be properly "
                      "processed as sym-tags. Use --branch=name to "
                      "add this checkin to a new branch and cancel "
                      "its previous branch tag.");
    goto end;
  }
#else
  if(0==fsl_strncmp("sym-",t, 4)){
    if(!t[4]){
      rc = fcli_err_set(FSL_RC_MISUSE,
                        "Missing suffix for sym- tag.");
    }else if(v){
      rc = fcli_err_set(FSL_RC_MISUSE,
    /* If we ever do allow sym- tags here, they must require
       a value. */
  }else{
                        "In a checkin, sym- tags may not "
                        "have a value.");
    }else if(FSL_TAGTYPE_PROPAGATING==ttype){
      /* We disallow propagating sym- tags here (1) for compatibility
         with how (fossil ci --tag) works and because it's unclear how
         they (mis?)interact with branch tags. */
      rc = fcli_err_set(FSL_RC_MISUSE,
                        "In a checkin, sym- tags may not "
                        "be propagating.");
    }
    if(rc) goto end;
 }
#endif
  {
    fsl_card_T * tt = fsl_card_T_malloc(ttype, 0, t, v);
    fsl_list_append(&App.liTags, tt)
      /*reminder: fcli will crash on alloc error*/;
  }
  end:
  fsl_free(tOrig);
  fsl_free(v);
138
139
140
141
142
143
144
145

146
147
148
149
150
151
152
159
160
161
162
163
164
165

166
167
168
169
170
171
172
173







-
+







    FCLI_FLAG_BOOL("i","integrate",&cOpt.integrate,
                   "Close all merge parents, not just integrate-merges."),
    FCLI_FLAG_X("t","tag","name[=value]",&App.tagArg,
                fcli_flag_callback_tag,
                "Adds the given tag with an optional value. "
                "May be used multiple times. "
                "Prefix the name with * for a propagating tag. "
                "A prefix of + (add tag) is equivalent to no prefix."
                "A prefix of + (add tag) is equivalent to no prefix. "
                "May NOT be used to remove flags, so tag names must "
                "not start with '-'."),
    FCLI_FLAG_BOOL(0,"baseline",&fBaseline,
                   "Force creationg of a baseline checkin artifact, not a delta. "
                   "Default is automatic determination."),
    FCLI_FLAG_BOOL("r","no-r-card",&fNoRCard,
                   "Disable calculation of the R-card."),
Changes to f-apps/f-sanity.c.
19
20
21
22
23
24
25
26

27
28

29

30
31
32
33
34
35
36
19
20
21
22
23
24
25

26
27
28
29

30
31
32
33
34
35
36
37







-
+


+
-
+







#undef NDEBUG
#endif

#ifdef _MSC_VER
#define THIS_SRC_FNAME "f-sanity.c"
/*A peculiarity of msvc x64 compiler (and not x86!) is that __FILE__ will be
a relative path as seen at compile-time.  But since the cwd of the compiler is
snot the source dir, this relative path will be incorrect at runtime, when our
not the source dir, this relative path will be incorrect at runtime, when our
cwd IS in the source dir, and tests will fail.*/
#else
// 2021-12-21: since moving to a top-level makefile, we can't use __FILE__ here...
#define THIS_SRC_FNAME __FILE__
#define THIS_SRC_FNAME "f-sanity.c"
#endif

#ifdef FSL_AMALGAMATION_BUILD
#include "../libfossil.h"
#else
#include "fossil-scm/fossil-cli.h" /* Fossil App mini-framework */
#include "fossil-scm/fossil-internal.h"
1340
1341
1342
1343
1344
1345
1346
1347

1348
1349
1350
1351
1352
1353
1354
1341
1342
1343
1344
1345
1346
1347

1348
1349
1350
1351
1352
1353
1354
1355







-
+







  const char * message = "Hi via clientState";
  fsl_confirm_response answer = fsl_confirm_response_empty;
  int rc;
  fsl_confirm_detail deets = fsl_confirm_detail_empty;

  assert(NULL==f->confirmer.callback);
  deets.eventId = FSL_CEVENT_OVERWRITE_MOD_FILE;
  deets.filename = __FILE__;
  deets.filename = THIS_SRC_FNAME;
  rc = fsl_cx_confirm(f, &deets, &answer);
  assert(0==rc);
  assert(FSL_CRESPONSE_NEVER==answer.response
         && "API guaranty violation");
  answer.response = FSL_CRESPONSE_INVALID;

  deets.eventId = FSL_CEVENT_OVERWRITE_UNMGD_FILE;
1379
1380
1381
1382
1383
1384
1385
1386

1387
1388
1389
1390
1391
1392
1393

1394
1395
1396
1397
1398
1399
1400

1401
1402
1403
1404
1405
1406
1407
1380
1381
1382
1383
1384
1385
1386

1387
1388
1389
1390
1391
1392
1393

1394
1395
1396
1397
1398
1399
1400

1401
1402
1403
1404
1405
1406
1407
1408







-
+






-
+






-
+







    fcon.callback = fsl_confirm_callback_f_test;
    fcon.callbackState = (void*)message;
    fsl_cx_confirmer(f, &fcon, &oldConfimer );
  }
  assert(fsl_confirm_callback_f_test==f->confirmer.callback);
  assert(message==f->confirmer.callbackState);
  deets.eventId = FSL_CEVENT_OVERWRITE_MOD_FILE;
  deets.filename = __FILE__;
  deets.filename = THIS_SRC_FNAME;
  rc = fsl_cx_confirm(f, &deets, &answer);
  assert(0==rc);
  assert(FSL_CRESPONSE_CANCEL==answer.response);
  answer.response = FSL_CRESPONSE_INVALID;

  deets.eventId = FSL_CEVENT_OVERWRITE_UNMGD_FILE;
  deets.filename = __FILE__;
  deets.filename = THIS_SRC_FNAME;
  rc = fsl_cx_confirm(f, &deets, &answer);
  assert(0==rc);
  assert(FSL_CRESPONSE_YES==answer.response);
  answer.response = FSL_CRESPONSE_INVALID;
  
  deets.eventId = FSL_CEVENT_RM_MOD_UNMGD_FILE;
  deets.filename = __FILE__;
  deets.filename = THIS_SRC_FNAME;
  rc = fsl_cx_confirm(f, &deets, &answer);
  assert(0==rc);
  assert(FSL_CRESPONSE_ALWAYS==answer.response);

  fsl_cx_confirmer(f, &oldConfimer, NULL );
  TEST_FOOTER;
}
1827
1828
1829
1830
1831
1832
1833
1834

1835
1836
1837
1838
1839
1840
1841
1828
1829
1830
1831
1832
1833
1834

1835
1836
1837
1838
1839
1840
1841
1842







-
+







     We need at least one file which is NOT part of the SCM, or we
     require changes to one of the above SCM'd files, for this test to
     actually run. Checkin will refuse to do anything if no files
     are modified.
  */
  fsl_ckout_manage_opt aOpt =
    fsl_ckout_manage_opt_empty;
  aOpt.filename = "Makefile"/*generated file*/;
  aOpt.filename = "../GNUmakefile"/*generated file*/;
  aOpt.relativeToCwd = true;
  aOpt.checkIgnoreGlobs = false;
  rc = fsl_ckout_manage(f, &aOpt);
  assert(!rc);
  assert(1==aOpt.counts.added);
  
  {
1885
1886
1887
1888
1889
1890
1891
1892

1893
1894

1895
1896
1897
1898
1899
1900
1901
1886
1887
1888
1889
1890
1891
1892

1893
1894

1895
1896
1897
1898
1899
1900
1901
1902







-
+

-
+









static void test_cx_glob_lists(void){
  fsl_cx * f = fcli_cx();
  char const * match;
  int globs = FSL_GLOBS_IGNORE;
  f_out("fsl_cx_glob_matches() tests...\n");
  match = fsl_cx_glob_matches(f, globs, "Makefile");
  match = fsl_cx_glob_matches(f, globs, "GNUmakefile");
  assert(match);
  assert(0==fsl_strcmp("Makefile",match));
  assert(0==fsl_strcmp("GNUmakefile",match));

  match = fsl_cx_glob_matches(f, globs, "f-apps/f-sanity");
  assert(match);

  match = fsl_cx_glob_matches(f, globs, "no-such-glob");
  assert(!match);

2355
2356
2357
2358
2359
2360
2361
2362

2363
2364
2365
2366
2367
2368
2369
2356
2357
2358
2359
2360
2361
2362

2363
2364
2365
2366
2367
2368
2369
2370







-
+







  fsl_buffer_clear(&b);
  TEST_FOOTER;
}

static void test_file_cp_mv(void){
  TEST_HEADER;
  int rc;
  char const *zFrom = __FILE__;
  char const *zFrom = THIS_SRC_FNAME;
  char const *zTo;
  char const *zTo2;
  fsl_buffer bTo = fsl_buffer_empty;
  fsl_buffer bTo2 = fsl_buffer_empty;

#if !FSL_PLATFORM_IS_WINDOWS
  assert(fsl_file_isexec("f-sanity"));
Added make-binding-cpp.make.in.

















































































































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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$(call ShakeNMake.CALL.CLEAN-SET,binding-cpp)
ifneq (1,$(MAKING_CLEAN))
binding-cpp: all
endif
LFPP.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
CXXFLAGS += -fPIC -Wall -Werror

DIR.cpp := $(DIR.bindings)/cpp
CPP.SRC := 	$(patsubst %,$(DIR.cpp)/%,\
	Context.cpp \
	Db.cpp \
	Deck.cpp \
	Exception.cpp \
	Fossil.cpp \
	OStream.cpp)

LFPP_OBJECTS := $(patsubst %.cpp,%.o,$(CPP.SRC))
$(LFPP_OBJECTS): $(LFPP.MAKEFILE)
libf++ := $(DIR.cpp)/libfossil++
$(libf++).DLL.OBJECTS := $(LFPP_OBJECTS)
$($(libf++).DLL.OBJECTS): $(libfossil.library)
$(libf++).BIN.LDFLAGS := -lstdc++ -fPIC $(LIBF_CLIENT_LDFLAGS)
$(libf++).LIB.OBJECTS := $($(libf++).DLL.OBJECTS)
$($(libf++).DLL.OBJECTS): $(MAKEFILE_LIST)
########################################################################
# Shared lib
$(eval $(call ShakeNMake.CALL.RULES.DLLS,$(libf++)))
$($(libf++).DLL): $($(libf++).DLL.OBJECTS)
CLEAN.binding-cpp += $($(libf++).DLL.OBJECTS) $($(libf++).DLL)
all: $($(libf++).DLL)

CPPTest := $(DIR.cpp)/test
$(CPPTest): $(libfossil.library)
$(CPPTest).BIN.OBJECTS := $(CPPTest).o
ifeq (0,1)
$(CPPTest).BIN.LDFLAGS := $($(libf++).BIN.LDFLAGS) $(EXTRA_LIBS) -lstdc++ -L. -lfossil++ @SH_LINKFLAGS@
else
$(CPPTest).BIN.OBJECTS += $($(libf++).DLL.OBJECTS)
$(CPPTest).BIN.LDFLAGS := $(LIBF_CLIENT_LDFLAGS) $(EXTRA_LIBS) -lstdc++ @SH_LINKFLAGS@
endif
$(eval $(call ShakeNMake.CALL.RULES.BINS,$(CPPTest)))
CLEAN.binding-cpp += $($(CPPTest).BIN) $($(CPPTest).BIN.OBJECTS)
all: $($(CPPTest).BIN)

########################################################################
# A quick-n-dirty amalgamation build...
LFPP.AMAL_D := $(DIR.top)
LFPP.AMAL_CPP := $(LFPP.AMAL_D)/libfossil++.cpp
LFPP.AMAL_HPP := $(LFPP.AMAL_D)/libfossil++.hpp
LFPP.AMAL_CONF.H := $(LFPP.AMAL_D)/libfossil-config.h
CLEAN.binding-cpp += $(LFPP.AMAL_HPP) $(LFPP.AMAL_CPP)

LFPP.AMAL_CPP.SRC := \
	$(CPP.SRC)

# ACHTUNG: in LFPP.AMAL_H.SRC, $(LFPP.AMAL_CONF.H) MUST be included first.
LFPP.AMAL_HPP.SRC := \
	$(DIR.include)/fossil-scm/fossil.hpp

$(LFPP.AMAL_HPP.SRC):
$(LFPP.AMAL_CPP.SRC):
$(LFPP.AMAL_HPP): $(LFPP.AMAL_HPP.SRC)
$(LFPP.AMAL_CPP): $(LFPP.AMAL_HPP) $(LFPP.AMAL_CPP.SRC)
$(LFPP.AMAL_CONF.H): $(MAIN_MAKEFILES)

$(LFPP.AMAL_HPP):
	@echo "Creating $@..."
	@{ \
		echo '#if !defined(FSLPP_AMALGAMATION_BUILD)'; \
		echo '#define FSLPP_AMALGAMATION_BUILD 1'; \
		echo '#endif'; \
		echo '#include "$(notdir $(libfossil.h))"'; \
	} > $@
	@{ \
		for i in $(LFPP.AMAL_HPP.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed  \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		 -e '/[ ]*#[ ]*include[ ]*.*".*config\.h[>"]/d' \
		>> $@

$(LFPP.AMAL_CPP): $(LFPP.AMAL_HPP)
	@echo "Creating $@..."
	@echo '#include "$(notdir $(LFPP.AMAL_HPP))"' > $@
	@{ \
		for i in $(LFPP.AMAL_CPP.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h.*[>"]/d' \
		>> $@

LFPP.AMAL_CPP_FLAGS := -I$(DIR.include) -I$(DIR.top) -I. -I$(DIR.src)# for sqlite3.h :/
.PHONY: amal
amalpp: $(LFPP.AMAL_CPP)
	@ls -ls $(LFPP.AMAL_CPP) $(LFPP.AMAL_HPP)
	@if which g++ >/dev/null; then \
		echo "Trying GCC..."; \
		g++ -c $(LFPP.AMAL_CPP) -pedantic -Wstrict-aliasing -Wall -Werror -Wno-long-long $(LFPP.AMAL_CPP_FLAGS); \
	fi; true
	@if which clang >/dev/null; then \
		echo "Trying clang..."; \
		clang -c $(LFPP.AMAL_CPP) -pedantic -Wstrict-aliasing -Wall -Werror -Wno-long-long $(LFPP.AMAL_CPP_FLAGS); \
	fi; true

# /amalgamation
########################################################################
CLEAN.binding-cpp += $(wildcard $(DIR.cpp)/*~)
Added make-client-fnc.make.in.











































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$(call ShakeNMake.CALL.CLEAN-SET,client-fnc)
ifneq (1,$(MAKING_CLEAN))
client-fnc: all
endif
DIR.fnc := $(DIR.client)/fnc
FNC.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
LIB_CURSES := @LIB_CURSES@
ifeq (,$(LIB_CURSES))
$(error Expecting LIB_CURSES to be set by the configure process.)
endif
CFLAGS_CURSES := @CFLAGS_CURSES@
fnc.CPPFLAGS += $(CFLAGS_CURSES)

########################################################################
# To build fnc, we need the curses and pthread libraries.
# -lz is for libfossil
# -liconv is for libfossil on macOS
# -lutil is... ???
# -lm is for sqlite3
FNC_LDFLAGS := $(LIBF_STATIC_CLIENT_LDFLAGS)
PLATFORM := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
ifneq ($(filter $(PLATFORM),Darwin),)
  FNC_LDFLAGS += -liconv
endif
FNC_LDFLAGS += $(LIB_CURSES) -lutil -lpthread
# This is needed for Mac builds, else they don't see the
# wide-char curses APIs:
fnc.CPPFLAGS += -D_XOPEN_SOURCE_EXTENDED

DFNC := $(DIR.fnc)/fnc
$(DFNC).BIN.OBJECTS += $(DFNC).o
$($(DFNC).BIN.OBJECTS): $(libfossil.h) $(FNC.MAKEFILE)
$(DFNC).BIN.LDFLAGS := $(FNC_LDFLAGS)
$(eval $(call ShakeNMake.CALL.RULES.BIN,$(DFNC)))
$($(DFNC).BIN): $(LIBF_STATIC_CLIENT_OBJ_DEPS)
all: $($(DFNC).BIN)
CLEAN.client-fnc := $($(DFNC).BIN) $($(DFNC).BIN.OBJECTS)
$(fnc.BIN.OBJECTS): $(LIBF_STATIC_CLIENT_OBJ_DEPS)
$(fnc.BIN.OBJECTS): CPPFLAGS+=$(fnc.CPPFLAGS)

ShakeNMake.install.bins += $($(DFNC).BIN)
ShakeNMake.install.man1 += $(DIR.fnc)/fnc.1
CLEAN.client-fnc += $(wildcard $(DIR.fnc)/*~)
Added make-f-apps.make.in.































































































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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$(call ShakeNMake.CALL.CLEAN-SET,f-apps)
ifneq (1,$(MAKING_CLEAN))
f-apps: all
endif
fapps.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))

fapps.ADDED_LIBF_STATIC := 0
ifeq (,$(CC_PROFILE_FLAG))
  fapps.LDFLAGS := -L$(DIR.top) -lfossil
else
  # For profiling builds to report useful stuff we have to statically
  # link...
  fapps.LDFLAGS := $(LIBF_STATIC_CLIENT_LDFLAGS)
  fapps.ADDED_LIBF_STATIC := 1
endif

ifeq (0,@LIBFOSSIL_SHARED@)
  # In static build, we need some extra flags...
  fapps.LDFLAGS += $(LDFLAGS_MODULE_LOADER)
ifeq (0,$(fapps.ADDED_LIBF_STATIC))
  fapps.LDFLAGS += $(LIBF_STATIC_CLIENT_LDFLAGS)
endif
endif

TEST_BINS_LDFLAGS := $(fapps.LDFLAGS) @SH_LINKFLAGS@
TEST_BINS_DEPS := $(libfossil.OBJ)
TEST_BINS_DEPS += $(libfossil.library)

########################################################################
# Sets up binary build rules for binary named $1. This only works
# for the basic test binaries which all have common compile/link
# bits. Assumes sources are in $1.c.
define RULES_F_BIN
# $(1).bin := $$(DIR.f-apps)/$(1)
$(1).BIN.OBJECTS += $(1).o
$$($(1).BIN.OBJECTS): $$(fapps.MAKEFILE)
$(1).BIN.LDFLAGS += $$(TEST_BINS_LDFLAGS)
$(call ShakeNMake.CALL.RULES.BIN,$(1))
$$($(1).BIN): $$(TEST_BINS_DEPS)
all: $$($(1).BIN)
CLEAN.f-apps += $$($(1).BIN) $$($(1).BIN.OBJECTS)
ifneq (,$(CC_PROFILE_FLAG))
$$($(1).BIN.OBJECTS): $$(LIBF_STATIC_CLIENT_OBJ_DEPS)
endif
endef

# Binaries which might get installed...
F_BINS.1 := $(patsubst %,$(DIR.f-apps)/%,\
  f-acat \
  f-add \
  f-adiff \
  f-annotate \
  f-aparse \
  f-ci \
  f-ciwoco \
  f-co \
  f-config \
  f-delta \
  f-extract \
  f-ls \
  f-merge \
  f-new \
  f-open \
  f-parseparty \
  f-query \
  f-rebuild \
  f-repostat \
  f-resolve \
  f-revert \
  f-rm \
  f-status \
  f-tag \
  f-timeline \
  f-update \
  f-vdiff \
  f-wiki \
  f-zip)

# Test/non-installed binaries...
F_BINS.2 := $(patsubst %,$(DIR.f-apps)/%,\
  f-event \
  f-sanity \
  f-sizeof \
  f-_scratchpad \
  f-_template \
  f-test-ciwoco \
  f-test-diff-builder \
  f-test-line-diff \
  f-test-merge3 \
  f-test-reserved-name-check \
  test)

ShakeNMake.install.bins += $(F_BINS.1)
$(foreach fbin,$(F_BINS.1) $(F_BINS.2),$(eval $(call RULES_F_BIN,$(fbin))))
CLEAN.fnc += $(wildcard $(DIR.f-apps)/*~)
Added make-libf-only.make.







1
2
3
4
5
6
7
+
+
+
+
+
+
+
# This file is a workaround to enable a clean rebuild of _just_ libf.
ifeq (,$(libfossil.c))
#^^^^^ make-libf.make not yet included
include make-libf.make
else
default:
endif
Added make-libf.make.in.














































































































































































































































































































































































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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ifneq (1,$(MAKING_CLEAN))
all: libf
endif
$(call ShakeNMake.CALL.CLEAN-SET,libf)

CPPFLAGS += -DBUILD_libfossil -DSQLITE_CORE
LIBF.EXTRA_LIBS := -lz
LIBF.EXTRA_LIBS += $(LDFLAGS_MODULE_LOADER)
LIBF.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
# libfossil*.* are "public" names for use with deps in subdir sources.
LIBF_AMAL_D := @srcdir@
libfossil.c := $(LIBF_AMAL_D)/libfossil.c
libfossil.o := $(LIBF_AMAL_D)/libfossil.o
libfossil.h := $(LIBF_AMAL_D)/libfossil.h
libfossil-config.h := $(LIBF_AMAL_D)/libfossil-config.h
CLEAN.libf += $(libfossil.o) $(libfossil.h) $(libfossil.c) $(libfossil-config.h)

# Flags for clients of the shared/static library:
LIBF_CLIENT_LDFLAGS := -L$(DIR.top) -lfossil -lz
SQLITE3.OBJ := $(DIR.src)/sqlite3.o
SQLITE3.C := $(wildcard $(DIR.src)/sqlite3.c)
ifneq (,$(SQLITE3.C))
  HAVE_OWN_SQLITE := 1
else
  HAVE_OWN_SQLITE := 0
  LIBF_CLIENT_LDFLAGS := -lsqlite3
endif
# $(libfossil.o) client .o files should have these as deps:
LIBF_STATIC_CLIENT_OBJ_DEPS := $(libfossil.o)
ifeq (1,$(HAVE_OWN_SQLITE))
  LIBF_STATIC_CLIENT_OBJ_DEPS += $(SQLITE3.OBJ)
endif
# $(libfossil.o) client .o files should link with:
LIBF_STATIC_CLIENT_LDFLAGS := $(LIBF_STATIC_CLIENT_OBJ_DEPS) -lz -lm
# ^^^ fixme: add -lpthread when using external sqlite3.


# FSL.SRC.BASE = all sources which can go in the amalgamation build
# FSL.SRC = FSL.SRC.BASE + generated/added sources
FSL.SRC.BASE := $(patsubst %,$(DIR.src)/%, \
	fsl.c \
	annotate.c \
	appendf.c \
	auth.c \
	bag.c \
	buffer.c \
	cache.c \
	checkin.c \
	checkout.c \
	cli.c \
	content.c \
	config.c \
	cx.c \
  db.c \
	deck.c \
	delta.c \
	diff.c \
	diff2.c \
	encode.c \
	event.c \
	fs.c \
	forum.c \
	glob.c \
	io.c \
	leaf.c \
	list.c \
	lookslike.c \
	md5.c \
	merge.c \
	merge3.c \
	popen.c \
	pq.c \
	repo.c \
	schema.c \
	search.c \
	sha1.c \
	sha3.c \
	strftime.c \
	tag.c \
	ticket.c \
	udf.c \
	utf8.c \
	vfile.c \
	vpath.c \
	wiki.c \
	zip.c)

FSL_ENABLE_SQLITE_REGEXP := 0
ifeq (1,$(FSL_ENABLE_SQLITE_REGEXP))
  FSL.SRC.BASE += ext_regexp.c
endif

FSL.SRC := $(FSL.SRC.BASE)
ifeq (1,$(HAVE_OWN_SQLITE))
  FSL.SRC += $(SQLITE3.C)
endif

FSL.OBJ := $(patsubst %.c,%.o,$(FSL.SRC))
$(FSL.OBJ): $(LIBF.MAKEFILE)
CLEAN.libf += $(FSL.OBJ)

########################################################################
# Transform schema SQL files into source form. We don't use fossil(1)'s
# approach because it relies on unspecified length limits on C string
# literals. Yeah, it works, but i'm funny about the C Standard.
#include $(TOP_SRCDIR_REL)/tools.make
BIN.TEXT2C := $(DIR.tools)/text2c
$(BIN.TEXT2C): $(DIR.tools)/text2c.c
	cc $< -o $@
DISTCLEAN.libf += $(BIN.TEXT2C)

define SQL2C
$(2):
$(1).c: $(2) $$(BIN.TEXT2C)
ifneq (1,$(MAKING_CLEAN))
	@echo "Creating $$@ from $(2)..."; \
	{ \
		echo '/* Binary form of file $(2) */'; \
		echo '/** @page page_$$(notdir $1) Schema: $$(notdir $(2))'; \
		echo '@code'; \
		cat "$(2)"; \
		echo ' @endcode'; \
		echo ' @see $$(subst _cstr,,$$(notdir $1))()'; \
		echo '*/'; \
		$$(BIN.TEXT2C) fsl_$$(notdir $1) < $(2); \
		echo '/* end of $(2) */'; \
	} > $$@;
endif
FSL.SRC += $(1).c
FSL.SRC.BASE += $(1).c
FSL.OBJ += $(1).o
DISTCLEAN.libf += $(1).c
sql: $(1).c
endef

SQL.DIR := @srcdir@/sql
$(eval $(call SQL2C,$(DIR.src)/schema_config_cstr,$(SQL.DIR)/config.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_repo1_cstr,$(SQL.DIR)/repo-static.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_repo2_cstr,$(SQL.DIR)/repo-transient.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_ckout_cstr,$(SQL.DIR)/checkout.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_ticket_cstr,$(SQL.DIR)/ticket.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_ticket_reports_cstr,$(SQL.DIR)/ticket-reports.sql))
$(eval $(call SQL2C,$(DIR.src)/schema_forum_cstr,$(SQL.DIR)/forum.sql))
# end SQL transformation bits
########################################################################

# These are the flags used by fossil's embedded sqlite3:
$(SQLITE3.OBJ): CPPFLAGS+=-DNDEBUG=1 \
                 -DSQLITE_DQS=0 \
                 -DSQLITE_THREADSAFE=0 \
                 -DSQLITE_DEFAULT_MEMSTATUS=0 \
                 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
                 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
                 -DSQLITE_OMIT_DECLTYPE \
                 -DSQLITE_OMIT_PROGRESS_CALLBACK \
                 -DSQLITE_OMIT_SHARED_CACHE \
                 -DSQLITE_OMIT_LOAD_EXTENSION \
                 -DSQLITE_MAX_EXPR_DEPTH=0 \
                 -DSQLITE_USE_ALLOCA \
                 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
                 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
                 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
                 -DSQLITE_ENABLE_FTS4 \
                 -DSQLITE_ENABLE_DBSTAT_VTAB \
                 -DSQLITE_ENABLE_JSON1 \
                 -DSQLITE_ENABLE_FTS5 \
                 -DSQLITE_ENABLE_STMTVTAB \
                 -DSQLITE_HAVE_ZLIB \
                 -DSQLITE_INTROSPECTION_PRAGMAS \
                 -DSQLITE_ENABLE_DBPAGE_VTAB \
                 -DSQLITE_TRUSTED_SCHEMA=0

# FIXME: update libf sql tracing: -DSQLITE_OMIT_DEPRECATED

$(SQLITE3.OBJ): CFLAGS+=-Wno-sign-compare
ifneq (,$(CC_PROFILE_FLAG))
$(SQLITE3.OBJ): CFLAGS:=$(filter-out $(CC_PROFILE_FLAG),$(CFLAGS))
# ^^^ gprof data into sqlite3 is just noise for us, so strip the
# profiling flag from this file.
endif
ifneq (,$(filter clang,$(CC)))
# Workaround for clang
$(SQLITE3.OBJ): CFLAGS+=-Wno-unused-const-variable
endif

CLEAN.libf += $(FSL.OBJ)
ifeq (1,$(HAVE_OWN_SQLITE))
# in-tree sqlite3
# -lm: one of the sqlite build opts (FTS?) requires log(3).
  LIBF.EXTRA_LIBS += -lm
else
# system/external sqlite3
  LIBF.EXTRA_LIBS += -lpthread
endif

libfossil.DLL.OBJECTS := $(FSL.OBJ)
libfossil.DLL.LDFLAGS := @SH_LDFLAGS@ $(LIBF.EXTRA_LIBS)
libfossil.LIB.OBJECTS := $(libfossil.DLL.OBJECTS)
########################################################################
# Shared lib
ifeq (1,@LIBFOSSIL_SHARED@)
$(eval $(call ShakeNMake.CALL.RULES.DLLS,libfossil))
CLEAN.libf += $(libfossil.DLL)
libf: $(libfossil.DLL)
$(libfossil.DLL): $(libfossil.DLL.OBJECTS)
ShakeNMake.install.dlls += $(libfossil.DLL)
endif

# Static lib
ifeq (1,@LIBFOSSIL_STATIC@)
$(eval $(call ShakeNMake.CALL.RULES.LIBS,libfossil))
libf: $(libfossil.LIB)
$(libfossil.LIB): $(libfossil.LIB.OBJECTS)
CLEAN.libf += $(libfossil.LIB)
ShakeNMake.install.libs += $(libfossil.LIB)
endif

########################################################################
# $(libfossil.library) is intended to be used as a dependency for
# clients which link to -lfossil. It will be either the DLL or LIB file
# for the library. Reminder: we cannot use $(wildcard) here because
# this string is, on the first build, eval'd before libfossil is
# compiled.
libfossil.library := $(word 1,$(libfossil.DLL) $(libfossil.LIB))
#$(info libfossil.library=$(libfossil.library))

########################################################################
# A quick-n-dirty amalgamation build...
DIR.inc-fossil := $(DIR.include)/fossil-scm

############################################################
# libfossil.c.SRC = the list of source files (.c and private .h) to include
# in $(libfossil.c).
#libfossil.c.SRC :=	fossil-ext_regexp.h
libfossil.c.SRC += \
	$(FSL.SRC.BASE)

ifeq (0,1)
# the tcl bits currently break the amalgamation
libfossil.c.SRC += \
	$(COMPAT_DIR)/javavm/export/jni_md.h \
	$(COMPAT_DIR)/javavm/export/jni.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tcl.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tclDecls.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tclPlatDecls.h
endif

############################################################
# libfossil.h.SRC = the list of public header files to include
# in $(libfossil.h).
libfossil.h.SRC := \
	$(DIR.inc-fossil)/fossil-config.h \
	$(DIR.inc-fossil)/fossil.h \
	$(DIR.inc-fossil)/fossil-util.h \
	$(DIR.inc-fossil)/fossil-core.h \
	$(DIR.inc-fossil)/fossil-db.h \
	$(DIR.inc-fossil)/fossil-hash.h \
	$(DIR.inc-fossil)/fossil-repo.h \
	$(DIR.inc-fossil)/fossil-checkout.h \
	$(DIR.inc-fossil)/fossil-confdb.h \
	$(DIR.inc-fossil)/fossil-vpath.h \
	$(DIR.inc-fossil)/fossil-internal.h \
	$(DIR.inc-fossil)/fossil-auth.h \
	$(DIR.inc-fossil)/fossil-forum.h \
	$(DIR.inc-fossil)/fossil-pages.h \
	$(DIR.inc-fossil)/fossil-cli.h
$(libfossil.h.SRC):
$(libfossil.c.SRC):
libfossil.h_MAKEFILES := $(filter-out $(ShakeNMake.CISH_DEPS_FILE),$(MAKEFILE_LIST))
$(libfossil.h): $(libfossil.h_MAKEFILES) $(libfossil.h.SRC) $(libfossil-config.h)
$(libfossil.c): $(libfossil.h_MAKEFILES) $(libfossil.h) $(libfossil.c.SRC)
$(libfossil-config.h): $(libfossil.h_MAKEFILES)
	@echo "Generating $@ ..."
	cd $(TOP_SRCDIR_REL) && sh configure --amal

$(libfossil.h): 
	@echo "Creating $@..."
	@{ \
		echo '#if !defined(FSL_AMALGAMATION_BUILD)'; \
		echo '#define FSL_AMALGAMATION_BUILD 1'; \
		echo '#endif'; \
		echo '#if defined(HAVE_CONFIG_H)'; \
		echo '#  include "config.h"'; \
		echo '#endif'; \
		echo '#include "$(notdir $(libfossil-config.h))"'; \
	} > $@
	@{ \
		for i in $(libfossil.h.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed  \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		 -e '/[ ]*#[ ]*include[ ]*.*".*config\.h"/d' \
		>> $@

$(libfossil.c): $(libfossil.h)
	@echo "Creating $@..."
	@echo '#include "$(notdir $(libfossil.h))"' > $@
	@{ \
		for i in $(libfossil.c.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		>> $@

$(libfossil.o): $(FSL.OBJ)# avoids mixed build output
amal: $(libfossil.c)
# /amalgamation
########################################################################

########################################################################
# amalgamation "unversioned" files for hosting in the main fossil repo
amal-dist.zip := libfossil-amalgamation.zip
amal-dist.html := amalgamation.html
FDB := $(wildcard .fslckout _FOSSIL_)
LIBF_AMAL_CPP_FLAGS := -I$(DIR.top)
LIBF_AMAL_CPP_FLAGS += -I$(DIR.src)# for local sqlite3.h and sqlite3ext.h
$(libfossil.o): $(libfossil.c) $(libfossil.h) $(libfossil-config.h) $(FSL.SRC)
	@echo "Amalgamation files:"; \
	ls -la $(libfossil.c) $(libfossil.h) $(libfossil-config.h)
	$(CC) $(CPPFLAGS) $(LIBF_AMAL_CPP_FLAGS) $(CFLAGS) -c "$<" -o "$@"
	@echo "Reminder: it will need these sqlite3 files to build:"; \
	echo "sqlite3.h, sqlite3ext.h, and optionally a local copy of sqlite3.c"
	@echo "Reminder: run 'amal-push' from the top dir to push a build to the main server."
amal: $(libfossil.o)
.PHONY: amal $(amal-dist.zip) $(amal-dist.html) $(FDB)
$(FDB):
	@test -f $@ || { echo "Missing fossil checkout db."; exit 1; }
$(amal-dist.zip): $(libfossil.o) $(FDB)
	zip $@ $(libfossil.c) $(libfossil.h) $(libfossil-config.h)
SQL_VINFO := select e.mtime,b.uuid from event e, blob b where b.rid=e.objid and e.type='ci' order by e.mtime desc limit 1;
# ^^^^^^^ ==> 12345.6789,'hash'
$(amal-dist.html): $(FDB)
	@{ \
	echo "<div class='fossil-doc' data-title='Downloads'>"; \
	echo "<style>#download-list{ line-height: 1.5; font-size: 125%; white-space: pre-wrap; }</style>"; \
	echo "<p>This page hosts builds of the libfossil "; \
	echo "<a href='../wiki/AmalgamationBuild'>AmalgamationBuild</a>. "; \
	echo "It only hosts the \"latest\" build and is updated periodically by a "; \
	echo "project contributor."; \
	echo "</p>"; \
	echo "<pre id='download-list'>"; \
	echo "<a href='$(amal-dist.zip)'>$(amal-dist.zip)</a>"; \
	echo "Size: $$(ls -la $(amal-dist.zip) | awk '{print $$5}') bytes"; \
	vinfo=$$(echo "$(SQL_VINFO)" | fossil sql); \
	echo "Last updated (YYYY-MM-DD):" $$(echo "select strftime('%Y-%m-%d %H:%M',$${vinfo%%,*})" | fossil sql | cut -d\' -f2) UTC; \
	version=$$(echo $${vinfo} | cut -d\' -f2); \
	echo "Source code version: <a href='../info/$${version:0:16}'>$${version:0:16}</a>"; \
	echo "Zip file SHA3-256 hash:" $$(fossil sha3sum $(amal-dist.zip) | cut -d' ' -f1); \
	echo "</pre>"; \
	} > $@
	@echo "Created $@"
amal-dist: $(amal-dist.zip) $(amal-dist.html)
	vinfo=$$(echo "$(SQL_VINFO)" | fossil sql); \
	fossil uv add $(amal-dist.zip) $(amal-dist.html) --mtime $${vinfo%%,*}
	fossil uv list
amal-push: amal-dist
	fossil uv sync

DISTCLEAN.libf += $(amal-dist.zip) $(amal-dist.html)
CLEAN.libf += $(wildcard $(DIR.src)/*~)
Changes to shakenmake.make.
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
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







-









-
-
-


-
-
+
+
+
+
+
+
+
+
+
+
+



-







# makefile and are considered "private" unless documented otherwise.
# Notable exceptions are most of the ShakeNMake.CALL entries, which
# are $(call)able functions, and ShakeNMake.EVAL entries, which are
# $(eval)able code.
#
########################################################################


########################################################################
# Calculate the top of the source tree, in case this is included
# from a subdir.
ShakeNMake.MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
$(ShakeNMake.MAKEFILE):# avoid breaking some deps checks if someone renames this file (been there, done that)
TOP_SRCDIR_REL ?= $(patsubst %/,%,$(dir $(ShakeNMake.MAKEFILE)))
#TOP_SRCDIR := $(shell cd -P $(TOP_SRCDIR_REL) && pwd)
TOP_SRCDIR := $(realpath $(TOP_SRCDIR_REL))
#$(error TOP_SRCDIR_REL=$(TOP_SRCDIR_REL)   TOP_SRCDIR=$(TOP_SRCDIR))
#TOP_INCDIR := $(TOP_SRCDIR_REL)/include
#TOP_INCDIR := $(TOP_SRCDIR)/include
#INCLUDES += -I. -I$(TOP_INCDIR) -I$(HOME)/include
#CPPFLAGS += $(INCLUDES)

#TOP_DIR ?= .#$(PWD)
#ShakeNMake.CISH_SOURCES += $(wildcard *.c)
MAKING_CLEAN ?= 0
ifneq (,$(strip $(filter distclean clean,$(MAKECMDGOALS))))
  MAKING_CLEAN:=1
endif
ifneq (,$(strip $(findstring clean-,$(MAKECMDGOALS))))
  # ^^^ if any clean-XXX or distclean-XXX target is run,
  # assume we're globally cleaning up. Using clean-xxx and non-clean
  # rules in the same invocation is madness.
  MAKING_CLEAN:=1
endif
#$(info MAKING_CLEAN=$(MAKING_CLEAN))

PACKAGE.MAKEFILE := $(firstword $(MAKEFILE_LIST))# normally either Makefile or GNUmakefile
$(PACKAGE.MAKEFILE):


########################################################################
# ShakeNMake.CALL.FIND_FILE call()able function:
# $1 = app name
# $2 = optional path ($(PATH) is always included)
ShakeNMake.CALL.FIND_FILE = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(2) $(PATH)))))
########################################################################
71
72
73
74
75
76
77
78

79
80
81
82
83
84
85
86
87
88

89
90























91
92
93
94
95
96
97
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124







-
+









-
+


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







.PHONY: clean distclean clean-. distclean-.
clean-%:
	@$(MAKE) --no-print-directory -C $* clean
clean-.:
	@-deep=0; while [[ $$deep -lt $(MAKELEVEL) ]]; do \
		echo -n $(ShakeNMake.SUBMAKE.INDENT); deep=$$((deep+1)); done; \
	echo "Cleaning up $(CURDIR)..."; \
	rm -f $@.$$$$ $(CLEAN_FILES) 
	rm -f ./$@.$$$$ $(CLEAN_FILES) 

clean: | clean-.

distclean-%:
	@$(MAKE) --no-print-directory -C $* distclean
distclean-.:
	@-deep=0; while [[ $$deep -lt $(MAKELEVEL) ]]; do \
		echo -n $(ShakeNMake.SUBMAKE.INDENT); deep=$$((deep+1)); done; \
	echo "Dist-cleaning $(CURDIR)..."; \
	rm -f $@.$$$$ $(CLEAN_FILES) $(DISTCLEAN_FILES) 
	rm -f ./$@.$$$$ $(CLEAN_FILES) $(DISTCLEAN_FILES) 
distclean: | distclean-.


########################################################################
# $(call)able which installs clean-$(1) and distclean-$(1) rules which
# rm's all files/dirs listed in $(CLEAN.$(1)) and $(DISTCLEAN.$(1))
# when the clean resp. distclean targets are run. The intention of
# this is to allow splitting-up of the CLEAN_FILES/DISTCLEAN_FILES
# into separate sets to avoid potential too-many-files problems on
# large top-level build files.
define ShakeNMake.EVAL.CLEAN-SET
clean-.: clean-$(1)
clean-$(1):
	@echo "Cleaning up [$(1)]..."; \
	rm -f ./$@.$$$$ $$(CLEAN.$(1))
distclean-.: distclean-$(1)
distclean-$(1):
	@echo "Dist-cleaning up [$(1)]..."; \
	rm -f ./$@.$$$$ $$(CLEAN.$(1)) $$(DISTCLEAN.$(1))
endef
# For each space-delimited argument, eval's ShakeNMake.EVAL.CLEAN-SET
# for that argument.
define ShakeNMake.CALL.CLEAN-SET
$(foreach cset,$(1),$(eval $(call ShakeNMake.EVAL.CLEAN-SET,$(cset))))
endef

########################################################################
# An internal hack to enable "quiet" output. $(1) is a string which
# is shown ONLY if ShakeNMake.QUIET!=1
ShakeNMake.QUIET ?= 0
define ShakeNMake.CALL.SETX
if test x1 = "x$(ShakeNMake.QUIET)"; then echo $(1); else set -x; fi
110
111
112
113
114
115
116
117

118

119
120

121
122
123
124
125
126
127
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151
152
153
154
155
156







-
+

+


+







#
########################################################################
# ShakeNMake.EVAL.RULES.LIB creates rules to build static library
# $(1).a
define ShakeNMake.EVAL.RULES.LIB
$(1).LIB = $(1).a
$(1).LIB: $$($(1).LIB)
CLEAN_FILES += $$($(1).LIB)
CLEAN.shakenmake += $$($(1).LIB)
$$($(1).LIB): $$($(1).LIB.OBJECTS)
ifneq (1,$$(MAKING_CLEAN))
	@$(call ShakeNMake.CALL.SETX,"AR [$$@]"); \
		$$(ShakeNMake.BIN.AR) crs $$@ $$($(1).LIB.OBJECTS)
endif
endef
define ShakeNMake.CALL.RULES.LIBS
$(foreach liba,$(1),$(eval $(call ShakeNMake.EVAL.RULES.LIB,$(liba))))
endef
# end ShakeNMake.EVAL.RULES.LIB
########################################################################

137
138
139
140
141
142
143
144

145

146
147
148
149
150
151

152
153
154
155
156
157
158
166
167
168
169
170
171
172

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189







-
+

+






+







# Also defines the var $(1).DLL, which expands to the filename of the DLL,
# (normally $(1)$(ShakeNMake.EXTENSIONS.DLL)).
define ShakeNMake.EVAL.RULES.DLL
$(1).DLL = $(1)$(ShakeNMake.EXTENSIONS.DLL)
ifneq (.DLL,$(ShakeNMake.EXTENSIONS.DLL))
$(1).DLL: $$($(1).DLL)
endif
CLEAN_FILES += $$($(1).DLL)
CLEAN.shakenmake += $$($(1).DLL)
$$($(1).DLL): $$($(1).DLL.SOURCES) $$($(1).DLL.OBJECTS)
ifneq (1,$$(MAKING_CLEAN))
	@test x = "x$$($(1).DLL.OBJECTS)$$($(1).DLL.SOURCES)" && { \
	echo "$(1).DLL.OBJECTS and/or $(1).DLL.SOURCES are/is undefined!"; exit 1; }; \
	$(call ShakeNMake.CALL.SETX,"LD [$$@]"); \
	 $$(CC) -o $$@ -shared $$(LDFLAGS) $(LDLIBS) \
		$$($(1).DLL.OBJECTS) \
		$$($(1).DLL.LDFLAGS)
endif
endef
########################################################################
# $(call ShakeNMake.CALL.RULES.DLLS,[list]) calls and $(eval)s
# ShakeNMake.EVAL.RULES.DLL for each entry in $(1)
define ShakeNMake.CALL.RULES.DLLS
$(foreach dll,$(1),$(eval $(call ShakeNMake.EVAL.RULES.DLL,$(dll))))
endef
173
174
175
176
177
178
179
180

181

182
183
184
185
186
187

188
189
190
191
192
193
194
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227







-
+

+






+







# Many developers feel that bins should not be cleaned by 'make
# clean', but instead by distclean, but i'm not one of those
# developers. i subscribe more to the school of thought that distclean
# is for cleaning up configure-created files. That said, shake-n-make
# isn't designed to use a configure-like process, so that is probably
# moot here and we probably (maybe?) should clean up bins only in
# distclean. As always: hack it to suit your preference:
CLEAN_FILES += $$($(1).BIN)
CLEAN.shakenmake += $$($(1).BIN)
$$($(1).BIN): $$($(1).BIN.OBJECTS)
ifneq (1,$$(MAKING_CLEAN))
	@test x = "x$$($(1).BIN.OBJECTS)" && { \
	echo "$(1).BIN.OBJECTS is undefined!"; exit 1; }; \
	$(call ShakeNMake.CALL.SETX,"LINK [$$@]"); \
	$$(CC) -o $$@ \
		$$($(1).BIN.OBJECTS) \
		$$(LDFLAGS) $$($(1).BIN.LDFLAGS)
endif
endef
########################################################################
# $(call ShakeNMake.EVAL.RULES.BINS,[list]) calls and $(eval)s
# ShakeNMake.CALL.RULES.BIN for each entry in $(1)
define ShakeNMake.CALL.RULES.BINS
$(foreach bin,$(1),$(eval $(call ShakeNMake.CALL.RULES.BIN,$(bin))))
endef
251
252
253
254
255
256
257

258
259
260
261
262
263
264
265
266
267
268
269


270
271
272
273
274
275
276
277
278






279

280
281
282
283
284
285
286







287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308

309
310



311
312
313
314
315
316
317
318
319
320





321
322
323
324
325
326
327

328
329
330
331
332
333
334
335








336
337
338
339
340
341
342
343
344

345
346
347
348
349
350
351







+












+
+



-


-
-
-
+
+
+
+
+
+

+


-
-
-
-
-
+
+
+
+
+
+
+
-








-
-
-
-
-
-
-
-









-







endef
define ShakeNMake.CALL.SUBDIRS
$(foreach dir,$(1),$(eval $(call ShakeNMake.CALL.SUBDIR,$(dir))))
endef
# end ShakeNMake.CALL.SUBDIRS and friends
########################################################################



########################################################################
# Automatic dependencies generation for C/C++ code...
# To disable deps generation, set ShakeNMake.USE_MKDEPS=0 *before*
# including this file.
ShakeNMake.USE_MKDEPS := 1
ifeq (,$(ShakeNMake.BIN.GCC))
ShakeNMake.USE_MKDEPS ?= 0
else
ShakeNMake.USE_MKDEPS ?= 1
endif
#$(warning ShakeNMake.USE_MKDEPS=$(ShakeNMake.USE_MKDEPS));
ShakeNMake.CISH_DEPS_FILE := .make.c_deps
$(ShakeNMake.CISH_DEPS_FILE):
ifeq (1,$(ShakeNMake.USE_MKDEPS))
ShakeNMake.CISH_SOURCES ?= $(wildcard *.cpp *.c *.c++ *.h *.hpp *.h++ *.hh)
#$(warning ShakeNMake.CISH_SOURCES=$(ShakeNMake.CISH_SOURCES))

ifneq (,$(ShakeNMake.CISH_SOURCES))
ShakeNMake.CISH_DEPS_FILE := .make.c_deps
ShakeNMake.BIN.MKDEP = gcc -w -E -MM $(CPPFLAGS)
#$(ShakeNMake.CISH_SOURCES): $(filter-out $(ShakeNMake.CISH_DEPS_FILE),$(MAKEFILE_LIST))
CLEAN_FILES += $(ShakeNMake.CISH_DEPS_FILE)
ShakeNMake.BIN.MKDEP = gcc -w -E -MM -MG -MP $(CPPFLAGS)
CLEAN.shakenmake += $(ShakeNMake.CISH_DEPS_FILE)
ShakeNMake.INJECTED_DEPS := $(filter-out $(ShakeNMake.CISH_DEPS_FILE),$(MAKEFILE_LIST))
ShakeNMake.INJECTED_DEPS := $(filter-out $(ShakeNMake.MAKEFILE),$(MAKEFILE_LIST))
# ^^^^ wouldn't normally do that but this file changes so seldom and deps generation
# takes ages on a raspberry pi.
$(ShakeNMake.CISH_DEPS_FILE): $(PACKAGE.MAKEFILE) $(ShakeNMake.MAKEFILE) $(ShakeNMake.CISH_SOURCES)
ifneq (1,$(MAKING_CLEAN))
	@touch $@; test x = "x$(ShakeNMake.CISH_SOURCES)" && exit 0; \
	echo "Generating dependencies..."; \
	$(ShakeNMake.BIN.MKDEP) $(ShakeNMake.CISH_SOURCES) 2>/dev/null > $@ || exit

#	perl -i -pe 's|^(.+)\.o:\s*((\w+/)*)|$(OBJ.DIR)/$$1.o: $(filter-out $(ShakeNMake.CISH_DEPS_FILE),$(MAKEFILE_LIST))\n$(OBJ.DIR)/$$1.o: $$2|' $@
# That perl bit is a big, ugly, tree-specific hack for libfossil!
# gcc -E -MM strips directory parts (why, i cannot imagine), so we've got to
	$(ShakeNMake.BIN.MKDEP) $(ShakeNMake.CISH_SOURCES) 2>/dev/null > $@
	@echo "Unmangling gcc-generated deps..."; \
	perl -i -pe 's|^(.+)\.o:\s*((\w+/)*)|$$3$$1.o: $(ShakeNMake.INJECTED_DEPS) $$2|' $@
endif
# Ugly tree-specific hack for libfossil:
# gcc -E -MM strips leading directory parts on the dep target
# (why, i cannot imagine), so we've got to hack its output.
# hack the output.
# Example: input= src/Foo.cpp
# Generated deps:
#  Foo.o: src/Foo.cpp ...
# So we re-extract that first path and prepend it to Foo.o using the
# above perl.  We also add $(MAKEFILE_LIST) has a prereq of all src
# files because i belong to the school of tought which believes that
# changes to the arbitrary build options set in the makefiles should
# cause a rebuild.
#	if [[ x = "x$(TOP_DIR)" ]]; then echo "REMOVE THIS TREE-SPECIFIC HACK!"; exit 1; fi;\
#ifeq (,$(TOP_DIR))
#$(error Tree-specific hack in place here. See the comments and remove these lines or set TOP_DIR)
#endif
# normally we also want:
#  || $(ShakeNMake.BIN.RM) -f $@ 2>/dev/null
# because we don't want a bad generated makefile to kill the build, but gcc -E
# is returning 1 when some generated files do not yet exist.
deps: $(ShakeNMake.CISH_DEPS_FILE)

ifneq (,$(strip $(filter distclean clean install,$(MAKECMDGOALS))))
# $(warning Skipping C/C++ deps generation.)
# ABSOLUTEBOGO := $(shell $(ShakeNMake.BIN.RM) -f $(ShakeNMake.CISH_DEPS_FILE))
else
#$(warning Including C/C++ deps.)
-include $(ShakeNMake.CISH_DEPS_FILE)
endif

endif
# ^^^^ ifneq(,$(ShakeNMake.CISH_SOURCES))
endif
# ^^^^ end $(ShakeNMake.USE_MKDEPS)
########################################################################

########################################################################
334
335
336
337
338
339
340
341

342
343
344
345
346
347
348
365
366
367
368
369
370
371

372
373
374
375
376
377
378
379







-
+







	-MP            \
	-MT $2         \
	$(CPPFLAGS)    \
	$(TARGET_ARCH) \
	$1
endef

CLEAN_FILES += $(wildcard *.o.d)
CLEAN.shakenmake += $(wildcard *.o.d)
%.o: %.c $(mkdir_compdb)
	@$(call ShakeNMake.CALL.SETX,"CC [$@]"); \
	$(COMPILE.c) -MM -MF $(@).d -MP -MT $@.d $(COMPILE.c.OPTIONS) $(OUTPUT_OPTION) $<
#	$(call ShakeNBake.CALL.MkDep.Tromey,$<,$@,$(@).d);

%.o: %.cpp
	@$(call ShakeNMake.CALL.SETX,"C++ [$@]"); \
380
381
382
383
384
385
386
387

388
389
390
391
392
393
394
411
412
413
414
415
416
417

418
419
420
421
422
423
424
425







-
+







	@echo "Creating $@..."; \
	for x in $(TAGTHESE); do echo $$x; done | $(bin_etags) -f $@ -; \
		touch $@; true
# ^^^^ Martin G. reports that etags fails with "Unknown option: -" on his
# Ubuntun 18.04 system. Since this isn't a critical feature, we can just
# force this step to succeed.
    tags: $(TAGFILE)
    CLEAN_FILES += $(TAGFILE)
    CLEAN.shakenmake += $(TAGFILE)
    all: $(TAGFILE)
endif
endif
# ^^^ bin_etags
endif
# ^^^ TOP_SRCDIR_REL==.
endif
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448


449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465

466

467
468
469
470
471
472
473
458
459
460
461
462
463
464








465
466
467
468
469


470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489

490
491
492
493
494
495
496
497







-
-
-
-
-
-
-
-





-
-
+
+

















+
-
+







# error when passed an empty file list. This was done because saner
# approaches to checking this failed to work on some older machines.
ShakeNMake.CALL.INSTALL.grep_kludge = echo $(1) "" | grep -q '[a-zA-Z0-9]' || exit 0
########################################################################
# $(call ShakeNMake.CALL.INSTALL,file_list,destdir[,install-sh-flags])
# Installs files $(1) to $(DESTDIR)$(2). $(3) is passed on to
# $(ShakeNMake.BIN.INSTALL).
#
# This code has some rather old logic in it when uses 'cmp' to compare
# the source and dest files, and does not update the destination if
# they are the same. This was originally in place because the install
# code was used to copy header files around the source tree during
# build-time, and we wanted to avoid breaking dependencies. It hasn't
# been used in that way in a long, long time (2003? 2004?) and can
# probably be removed, as it just slows down the install process.
ShakeNMake.CALL.INSTALL = $(call ShakeNMake.CALL.INSTALL.grep_kludge,$(1)); \
	tgtdir="$(DESTDIR)$(2)"; \
	test -d "$$tgtdir" || mkdir -p "$${tgtdir}" \
		|| { err=$$?; echo "$(@): mkdir -p $${tgtdir} failed"; exit $$err; }; \
	for b in $(1) ""; do test -z "$$b" && continue; \
		b=$${b\#\#*/}; \
		target="$${tgtdir}/$$b"; \
		b2=$${b\#\#*/}; \
		target="$${tgtdir}/$$b2"; \
		cmd="$(ShakeNMake.BIN.INSTALL) $(3) $$b $$target"; echo $$cmd; $$cmd || exit; \
	done

########################################################################
# $(call ShakeNMake.CALL.UNINSTALL,file_list,source_dir)
# removes all files listed in $(1) from target directory $(DESTDIR)$(2).
#
# Maintenance reminder:
# The while/rmdir loop is there to clean up empty dirs left over by
# the uninstall. This is very arguable but seems more or less
# reasonable. The loop takes care to stop when it reaches $(DESTDIR),
# since DESTDIR is presumably (but not necessarily) created by another
# authority.
ShakeNMake.CALL.UNINSTALL =  $(call ShakeNMake.CALL.INSTALL.grep_kludge,$(1)); \
	tgtdir="$(DESTDIR)$(2)"; \
	test -e "$${tgtdir}" || exit 0; \
	for b in $(1) ""; do test -z "$$b" && continue; \
		b2=$${b\#\#*/}; \
		fp="$${tgtdir}/$$b"; test -e "$$fp" || continue; \
		fp="$${tgtdir}/$$b2"; test -e "$$fp" || continue; \
		cmd="rm $$fp"; echo $$cmd; $$cmd || exit $$?; \
	done; \
	tgtdir="$(2)"; \
	while test x != "x$${tgtdir}" -a '$(prefix)' != "$${tgtdir}" \
		-a '/' != "$${tgtdir}" -a -d "$(DESTDIR)$${tgtdir}"; do \
		rmdir $(DESTDIR)$${tgtdir} 2>/dev/null || break; \
		echo "Removing empty dir: $(DESTDIR)$${tgtdir}"; \
532
533
534
535
536
537
538

556
557
558
559
560
561
562
563







+
#$(call ShakeNMake.CALL.define-install-set,docs,$(prefix)/share/doc/$(package.name),$(ShakeNMake.INSTALL.flags.nonbins))
# Set up man page entries...
$(foreach NUM,1 2 3 4 5 6 7 8 9,$(call \
	ShakeNMake.CALL.define-install-set,man$(NUM),$(prefix)/share/man/man$(NUM),$(ShakeNMake.INSTALL.flags.nonbins)))
endif
# /install
########################################################################
$(call ShakeNMake.CALL.CLEAN-SET,shakenmake)
Added src/GNUmakefile.





1
2
3
4
5
+
+
+
+
+
all:
clean:
	$(MAKE) -C .. libf-only clean-libf
%:
	$(MAKE) -C .. libf-only $@
Deleted src/Makefile.in.
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287































































































































































































































































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
all:
include ../subdir-inc.make
#$(error $(TOP_SRCDIR))
CPPFLAGS += -DBUILD_libfossil -DSQLITE_CORE
#CPPFLAGS += -I$(TOP_INCDIR)
#CPPFLAGS += -I$(TOP_SRCDIR)/include
#CPPFLAGS += -I$(TOP_SRCDIR)/src# workaround for in-tree sqlite3.h
EXTRA_LIBS := -lz
EXTRA_LIBS +=  $(LDFLAGS_MODULE_LOADER)
DISTCLEAN_FILES += Makefile
#INCLUDES_PATH ?= $(HOME)/include /usr/local/include /usr/include


# FSL.SRC.BASE = all sources which can go in the amalgamation build
# FSL.SRC = FSL.SRC.BASE + generated/added sources
FSL.SRC.BASE := \
	fsl.c \
	annotate.c \
	appendf.c \
	auth.c \
	bag.c \
	buffer.c \
	cache.c \
	checkin.c \
	checkout.c \
	cli.c \
	content.c \
	config.c \
	cx.c \
  db.c \
	deck.c \
	delta.c \
	diff.c \
	diff2.c \
	encode.c \
	event.c \
	fs.c \
	forum.c \
	glob.c \
	io.c \
	leaf.c \
	list.c \
	lookslike.c \
	md5.c \
	merge.c \
	merge3.c \
	popen.c \
	pq.c \
	repo.c \
	schema.c \
	search.c \
	sha1.c \
	sha3.c \
	strftime.c \
	tag.c \
	ticket.c \
	udf.c \
	utf8.c \
	vfile.c \
	vpath.c \
	wiki.c \
	zip.c

FSL_ENABLE_SQLITE_REGEXP := 0
ifeq (1,$(FSL_ENABLE_SQLITE_REGEXP))
  FSL.SRC.BASE += ext_regexp.c
endif

FSL.SRC := $(FSL.SRC.BASE)

ifneq (,$(wildcard sqlite3.c))
  FSL.SRC += sqlite3.c
  HAVE_OWN_SQLITE := 1
else
  HAVE_OWN_SQLITE := 0
endif

FSL.OBJ := $(patsubst %.c,%.o,$(FSL.SRC))

########################################################################
# Transform schema SQL files into source form. We don't use fossil(1)'s
# approach because it relies on unspecified length limits on C string
# literals. Yeah, it works, but i'm funny about the C Standard.
#include $(TOP_SRCDIR_REL)/tools.make
DIR.TOOLS := $(TOP_SRCDIR_REL)/tools
BIN.TEXT2C := $(DIR.TOOLS)/text2c
$(BIN.TEXT2C): $(DIR.TOOLS)/text2c.c
	cc $< -o $@
CLEAN_FILES += $(BIN.TEXT2C)

define SQL2C
$(2):
$(1).c: $(2) $$(BIN.TEXT2C)
	@echo "Creating $$@ from $(2)..."; \
	{ \
		echo '/* Binary form of file $(2) */'; \
		echo '/** @page page_$(1) Schema: $$(notdir $(2))'; \
		echo '@code'; \
		cat "$(2)"; \
		echo ' @endcode'; \
		echo ' @see $$(subst _cstr,,$(1))()'; \
		echo '*/'; \
		$$(BIN.TEXT2C) fsl_$(1) < $(2); \
		echo '/* end of $(2) */'; \
	} > $$@;
FSL.SRC += $(1).c
FSL.SRC.BASE += $(1).c
FSL.OBJ += $(1).o
DISTCLEAN_FILES += $(1).c
sql: $(1).c
endef

SQL.DIR := $(TOP_SRCDIR_REL)/sql
$(eval $(call SQL2C,schema_config_cstr,$(SQL.DIR)/config.sql))
$(eval $(call SQL2C,schema_repo1_cstr,$(SQL.DIR)/repo-static.sql))
$(eval $(call SQL2C,schema_repo2_cstr,$(SQL.DIR)/repo-transient.sql))
$(eval $(call SQL2C,schema_ckout_cstr,$(SQL.DIR)/checkout.sql))
$(eval $(call SQL2C,schema_ticket_cstr,$(SQL.DIR)/ticket.sql))
$(eval $(call SQL2C,schema_ticket_reports_cstr,$(SQL.DIR)/ticket-reports.sql))
$(eval $(call SQL2C,schema_forum_cstr,$(SQL.DIR)/forum.sql))
# end SQL transformation bits
########################################################################

# These are the flags used by fossil's embedded sqlite3:
sqlite3.o: CPPFLAGS+=-DNDEBUG=1 \
                 -DSQLITE_DQS=0 \
                 -DSQLITE_THREADSAFE=0 \
                 -DSQLITE_DEFAULT_MEMSTATUS=0 \
                 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
                 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
                 -DSQLITE_OMIT_DECLTYPE \
                 -DSQLITE_OMIT_PROGRESS_CALLBACK \
                 -DSQLITE_OMIT_SHARED_CACHE \
                 -DSQLITE_OMIT_LOAD_EXTENSION \
                 -DSQLITE_MAX_EXPR_DEPTH=0 \
                 -DSQLITE_USE_ALLOCA \
                 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
                 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
                 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
                 -DSQLITE_ENABLE_FTS4 \
                 -DSQLITE_ENABLE_DBSTAT_VTAB \
                 -DSQLITE_ENABLE_JSON1 \
                 -DSQLITE_ENABLE_FTS5 \
                 -DSQLITE_ENABLE_STMTVTAB \
                 -DSQLITE_HAVE_ZLIB \
                 -DSQLITE_INTROSPECTION_PRAGMAS \
                 -DSQLITE_ENABLE_DBPAGE_VTAB \
                 -DSQLITE_TRUSTED_SCHEMA=0

# FIXME: update libf sql tracing: -DSQLITE_OMIT_DEPRECATED

sqlite3.o: CFLAGS+=-Wno-sign-compare
ifneq (,$(CC_PROFILE_FLAG))
sqlite3.o: CFLAGS:=$(filter-out $(CC_PROFILE_FLAG),$(CFLAGS))
# ^^^ gprof data into sqlite3 is just noise for us, so strip the
# profiling flag from this file.
endif
ifneq (,$(filter clang,$(CC)))
# Workaround for clang
sqlite3.o: CFLAGS+=-Wno-unused-const-variable
endif

CLEAN_FILES += $(FSL.OBJ)
ifeq (1,$(HAVE_OWN_SQLITE))
# in-tree sqlite3
# -lm: one of the sqlite build opts (FTS?) requires log(3).
  EXTRA_LIBS += -lm
else
# system/external sqlite3
  EXTRA_LIBS += -lpthread
endif

libfossil.DLL.OBJECTS := $(FSL.OBJ)
libfossil.DLL.LDFLAGS := @SH_LDFLAGS@ $(EXTRA_LIBS)
libfossil.LIB.OBJECTS := $(libfossil.DLL.OBJECTS)
########################################################################
# Shared lib
ifeq (1,@LIBFOSSIL_SHARED@)
$(eval $(call ShakeNMake.CALL.RULES.DLLS,libfossil))
all: $(libfossil.DLL)
$(libfossil.DLL): $(libfossil.DLL.OBJECTS)
ShakeNMake.install.dlls := $(libfossil.DLL)
endif

# Static lib
ifeq (1,@LIBFOSSIL_STATIC@)
$(eval $(call ShakeNMake.CALL.RULES.LIBS,libfossil))
all: $(libfossil.LIB)
$(libfossil.LIB): $(libfossil.LIB.OBJECTS)
ShakeNMake.install.libs := $(libfossil.LIB)
endif

########################################################################
# A quick-n-dirty amalgamation build...
INCD := $(TOP_INCDIR)/fossil-scm
AMAL_D := $(TOP_SRCDIR_REL)
AMAL_C := $(AMAL_D)/libfossil.c
AMAL_O := $(AMAL_D)/libfossil.o
AMAL_H := $(AMAL_D)/libfossil.h
AMAL_CONF.H := $(AMAL_D)/libfossil-config.h
CLEAN_FILES += $(AMAL_H) $(AMAL_C) $(AMAL_CONF.H)

############################################################
# AMAL_C.SRC = the list of source files (.c and private .h) to include
# in $(AMAL_C).
#AMAL_C.SRC :=	fossil-ext_regexp.h
AMAL_C.SRC += \
	$(FSL.SRC.BASE)

ifeq (0,1)
# the tcl bits currently break the amalgamation
AMAL_C.SRC += \
	$(COMPAT_DIR)/javavm/export/jni_md.h \
	$(COMPAT_DIR)/javavm/export/jni.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tcl.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tclDecls.h \
	$(COMPAT_DIR)/tcl-8.6/generic/tclPlatDecls.h
endif

############################################################
# AMAL_H.SRC = the list of public header files to include
# in $(AMAL_H).
AMAL_H.SRC := \
	$(INCD)/fossil-config.h \
	$(INCD)/fossil.h \
	$(INCD)/fossil-util.h \
	$(INCD)/fossil-core.h \
	$(INCD)/fossil-db.h \
	$(INCD)/fossil-hash.h \
	$(INCD)/fossil-repo.h \
	$(INCD)/fossil-checkout.h \
	$(INCD)/fossil-confdb.h \
	$(INCD)/fossil-vpath.h \
	$(INCD)/fossil-internal.h \
	$(INCD)/fossil-auth.h \
	$(INCD)/fossil-forum.h \
	$(INCD)/fossil-pages.h \
	$(INCD)/fossil-cli.h
$(AMAL_H.SRC):
$(AMAL_C.SRC):
AMAL_H_MAKEFILES := $(filter-out $(ShakeNMake.CISH_DEPS_FILE),$(MAKEFILE_LIST))
$(AMAL_H): $(AMAL_H_MAKEFILES) $(AMAL_H.SRC) $(AMAL_CONF.H)
$(AMAL_C): $(AMAL_H_MAKEFILES) $(AMAL_H) $(AMAL_C.SRC)
$(AMAL_CONF.H): $(AMAL_H_MAKEFILES)
	@echo "Generating $@ ..."
	cd $(TOP_SRCDIR_REL) && sh configure --amal

$(AMAL_H): 
	@echo "Creating $@..."
	@{ \
		echo '#if !defined(FSL_AMALGAMATION_BUILD)'; \
		echo '#define FSL_AMALGAMATION_BUILD 1'; \
		echo '#endif'; \
		echo '#if defined(HAVE_CONFIG_H)'; \
		echo '#  include "config.h"'; \
		echo '#endif'; \
		echo '#include "$(notdir $(AMAL_CONF.H))"'; \
	} > $@
	@{ \
		for i in $(AMAL_H.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed  \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		 -e '/[ ]*#[ ]*include[ ]*.*".*config\.h"/d' \
		>> $@

$(AMAL_C): $(AMAL_H)
	@echo "Creating $@..."
	@echo '#include "$(notdir $(AMAL_H))"' > $@
	@{ \
		for i in $(AMAL_C.SRC); do \
			echo "/* start of file $$i */"; \
			cat $$i; \
			echo "/* end of file $$i */"; \
		done; \
	} | sed \
		 -e '/[ ]*#[ ]*include[ ]*.*fossil.*\.h[>"]/d' \
		>> $@

$(AMAL_O): $(FSL.OBJ)# avoids mixed build output
#all: $(AMAL_C)
amal: $(AMAL_C)
# /amalgamation
########################################################################
Changes to src/schema_ckout_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/checkout.sql */
/* Binary form of file ./sql/checkout.sql */
/** @page page_schema_ckout_cstr Schema: checkout.sql
@code
-- The VVAR table holds miscellanous information about the local database
-- in the form of name-value pairs.  This is similar to the VAR table
-- table in the repository except that this table holds information that
-- is specific to the local checkout.
--
262
263
264
265
266
267
268
269

262
263
264
265
266
267
268

269







-
+
115, 32, 102, 105, 108, 101, 32, 116, 121, 112, 101, 46, 10, 45, 45, 32, 84, 104, 101, 32, 
105, 110, 116, 101, 103, 101, 114, 32, 105, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 
97, 115, 32, 39, 70, 83, 76, 67, 39, 46, 10, 80, 82, 65, 71, 77, 65, 32, 99, 107, 
111, 117, 116, 46, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 105, 100, 61, 50, 
53, 50, 48, 48, 54, 54, 55, 52, 59, 10, 
0};
char const * fsl_schema_ckout_cstr = fsl_schema_ckout_cstr_a;
/* end of ../sql/checkout.sql */
/* end of ./sql/checkout.sql */
Changes to src/schema_config_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/config.sql */
/* Binary form of file ./sql/config.sql */
/** @page page_schema_config_cstr Schema: config.sql
@code
-- This file contains the schema for the database that is kept in the
-- ~/.fossil file and that stores information about the users setup.
--
CREATE TABLE cfg.global_config(
  name TEXT PRIMARY KEY,
32
33
34
35
36
37
38
39

32
33
34
35
36
37
38

39







-
+
105, 108, 101, 32, 116, 121, 112, 101, 46, 10, 45, 45, 32, 84, 104, 101, 32, 105, 110, 116, 
101, 103, 101, 114, 32, 105, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 97, 115, 32, 
39, 70, 83, 76, 71, 39, 46, 10, 80, 82, 65, 71, 77, 65, 32, 99, 102, 103, 46, 97, 
112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 95, 105, 100, 61, 50, 53, 50, 48, 48, 54, 
54, 55, 53, 59, 10, 
0};
char const * fsl_schema_config_cstr = fsl_schema_config_cstr_a;
/* end of ../sql/config.sql */
/* end of ./sql/config.sql */
Changes to src/schema_forum_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/forum.sql */
/* Binary form of file ./sql/forum.sql */
/** @page page_schema_forum_cstr Schema: forum.sql
@code
CREATE TABLE repo.forumpost(
  fpid INTEGER PRIMARY KEY,  -- BLOB.rid for the artifact
  froot INT,                 -- fpid of the thread root
  fprev INT,                 -- Previous version of this same post
  firt INT,                  -- This post is in-reply-to
32
33
34
35
36
37
38
39

32
33
34
35
36
37
38

39







-
+
104, 101, 110, 32, 112, 111, 115, 116, 101, 100, 46, 32, 32, 74, 117, 108, 105, 97, 110, 32, 
100, 97, 121, 10, 41, 59, 10, 67, 82, 69, 65, 84, 69, 32, 73, 78, 68, 69, 88, 32, 
114, 101, 112, 111, 46, 102, 111, 114, 117, 109, 116, 104, 114, 101, 97, 100, 32, 79, 78, 32, 
102, 111, 114, 117, 109, 112, 111, 115, 116, 40, 102, 114, 111, 111, 116, 44, 102, 109, 116, 105, 
109, 101, 41, 59, 10, 
0};
char const * fsl_schema_forum_cstr = fsl_schema_forum_cstr_a;
/* end of ../sql/forum.sql */
/* end of ./sql/forum.sql */
Changes to src/schema_repo1_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/repo-static.sql */
/* Binary form of file ./sql/repo-static.sql */
/** @page page_schema_repo1_cstr Schema: repo-static.sql
@code
-- This file contains parts of the schema that are fixed and
-- unchanging across Fossil versions.


-- The BLOB and DELTA tables contain all records held in the repository.
422
423
424
425
426
427
428
429

422
423
424
425
426
427
428

429







-
+
32, 99, 111, 109, 109, 97, 110, 100, 32, 116, 111, 32, 105, 100, 101, 110, 116, 105, 102, 121, 
32, 116, 104, 101, 10, 45, 45, 32, 100, 97, 116, 97, 98, 97, 115, 101, 32, 97, 115, 32, 
97, 32, 102, 111, 115, 115, 105, 108, 32, 114, 101, 112, 111, 115, 105, 116, 111, 114, 121, 46, 
10, 80, 82, 65, 71, 77, 65, 32, 114, 101, 112, 111, 46, 97, 112, 112, 108, 105, 99, 97, 
116, 105, 111, 110, 95, 105, 100, 61, 50, 53, 50, 48, 48, 54, 54, 55, 51, 59, 10, 
0};
char const * fsl_schema_repo1_cstr = fsl_schema_repo1_cstr_a;
/* end of ../sql/repo-static.sql */
/* end of ./sql/repo-static.sql */
Changes to src/schema_repo2_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/repo-transient.sql */
/* Binary form of file ./sql/repo-transient.sql */
/** @page page_schema_repo2_cstr Schema: repo-transient.sql
@code
-- This file contains parts of the schema that can change from one
-- version to the next. The data stored in these tables is
-- reconstructed from the information in the main repo schema by the
-- "rebuild" operation.

702
703
704
705
706
707
708
709

702
703
704
705
706
707
708

709







-
+
105, 108, 100, 105, 100, 41, 10, 41, 32, 87, 73, 84, 72, 79, 85, 84, 32, 82, 79, 87, 
73, 68, 59, 10, 67, 82, 69, 65, 84, 69, 32, 73, 78, 68, 69, 88, 32, 114, 101, 112, 
111, 46, 99, 104, 101, 114, 114, 121, 112, 105, 99, 107, 95, 99, 105, 100, 32, 79, 78, 32, 
99, 104, 101, 114, 114, 121, 112, 105, 99, 107, 40, 99, 104, 105, 108, 100, 105, 100, 41, 59, 
10, 
0};
char const * fsl_schema_repo2_cstr = fsl_schema_repo2_cstr_a;
/* end of ../sql/repo-transient.sql */
/* end of ./sql/repo-transient.sql */
Changes to src/schema_ticket_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/ticket.sql */
/* Binary form of file ./sql/ticket.sql */
/** @page page_schema_ticket_cstr Schema: ticket.sql
@code
-- Template for the TICKET table
CREATE TABLE repo.ticket(
  -- Do not change any column that begins with tkt_
  tkt_id INTEGER PRIMARY KEY,
  tkt_uuid TEXT UNIQUE,
75
76
77
78
79
80
81
82

75
76
77
78
79
80
81

82







-
+
109, 101, 110, 116, 32, 84, 69, 88, 84, 10, 41, 59, 10, 67, 82, 69, 65, 84, 69, 32, 
73, 78, 68, 69, 88, 32, 114, 101, 112, 111, 46, 116, 105, 99, 107, 101, 116, 99, 104, 110, 
103, 95, 105, 100, 120, 49, 32, 79, 78, 32, 116, 105, 99, 107, 101, 116, 99, 104, 110, 103, 
40, 116, 107, 116, 95, 105, 100, 44, 32, 116, 107, 116, 95, 109, 116, 105, 109, 101, 41, 59, 
10, 
0};
char const * fsl_schema_ticket_cstr = fsl_schema_ticket_cstr_a;
/* end of ../sql/ticket.sql */
/* end of ./sql/ticket.sql */
Changes to src/schema_ticket_reports_cstr.c.
1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







/* Binary form of file ../sql/ticket-reports.sql */
/* Binary form of file ./sql/ticket-reports.sql */
/** @page page_schema_ticket_reports_cstr Schema: ticket-reports.sql
@code
INSERT INTO reportfmt(title,mtime,cols,sqlcode) 
VALUES('All Tickets',julianday('1970-01-01'),'#ffffff Key:
#f2dcdc Active
#e8e8e8 Review
#cfe8bd Fixed
57
58
59
60
61
62
63
64

57
58
59
60
61
62
63

64







-
+
100, 97, 116, 101, 116, 105, 109, 101, 40, 116, 107, 116, 95, 109, 116, 105, 109, 101, 41, 32, 
65, 83, 32, 39, 39, 109, 116, 105, 109, 101, 39, 39, 44, 10, 32, 32, 116, 121, 112, 101, 
44, 10, 32, 32, 115, 116, 97, 116, 117, 115, 44, 10, 32, 32, 115, 117, 98, 115, 121, 115, 
116, 101, 109, 44, 10, 32, 32, 116, 105, 116, 108, 101, 10, 70, 82, 79, 77, 32, 116, 105, 
99, 107, 101, 116, 39, 41, 59, 10, 
0};
char const * fsl_schema_ticket_reports_cstr = fsl_schema_ticket_reports_cstr_a;
/* end of ../sql/ticket-reports.sql */
/* end of ./sql/ticket-reports.sql */