From 04e068daab882b32df319da5446c4bbacce15078 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 1 Nov 2025 19:39:14 +0900 Subject: [PATCH] updated build files to produce hakgo under bin --- Makefile.am | 52 ---------------- Makefile.in | 162 +++++++----------------------------------------- bin/Makefile.am | 57 +++++++++++++++++ bin/Makefile.in | 72 ++++++++++++++++++--- 4 files changed, 142 insertions(+), 201 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1c3d676..852cdb5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,55 +20,3 @@ clean-local: rm -rf $(builddir)/go.mod $(builddir)/go.sum go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod -cache -if ENABLE_HAKGO - -## the attempt to compose a proper procedure using a regular compiler failed. -## e.g ./configure GOC=opt/go/pkg/tool/linux_amd64/ -## while go.m4 is included in autoconf 2.71, the support for the go language -## is very limited and the go language itself is pursuing the module based builder. -## -## the following is to trick autoconf/automake as if it's building go files with -## a real compiler whereas the actual building is done thru `go build` - -bin_PROGRAMS = bin/hakgo -bin_hakgo_SOURCES = \ - hak.go \ - hak-cb.go \ - hak-inst.go \ - bin/main.go \ - go.mod -bin_hakgo_DEPENDENCIES = hakgo.bin - -## let the linker to move hakgo.bin to the actual target -##bin_hakgo_LINK = mv -f hakgo.bin hakgo$(EXEEXT) || echo "FAILED TO LINK" - -if ENABLE_STATIC -CGO_CFLAGS_EXTRA="-static" -CGO_LDFLAGS_EXTRA="-static" -else -CGO_CFLAGS_EXTRA="" -CGO_LDFLAGS_EXTRA="" -endif - -bin/hakgo$(EXEEXT): lib/libhak.la $(hakgo_OBJECTS) - cp -pf $(srcdir)/go.mod $(builddir)/go.mod >/dev/null 2>&1 || true - chmod u+w $(builddir)/go.mod ## with `make distcheck`, the echo's redirection to the file fails without this permission change - [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true - ## --------------------------------------------------------------- - CC=$(CC) \ - CGO_CFLAGS="-I$(abs_srcdir)/lib -I$(abs_builddir)/lib $(CFLAGS) $(CGO_CFLAGS_EXTRA)" \ - CGO_LDFLAGS="-L$(abs_builddir)/lib -L$(abs_builddir)/lib/.libs -lhak -ldl $(LIBM) $(CGO_LDFLAGS_EXTRA)" \ - go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/$@ -modfile $(abs_builddir)/go.mod $(abs_srcdir)/bin/main.go - ## --------------------------------------------------------------- - go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod - -## the go to o recipe is fake to deceive make -.go.o: - echo $< > $@ - -.mod.o: - echo $< > $@ - -endif - - diff --git a/Makefile.in b/Makefile.in index c734037..74ee6c6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -92,7 +91,6 @@ build_triplet = @build@ host_triplet = @host@ @ENABLE_STATIC_MODULE_TRUE@am__append_1 = mod lib bin t @ENABLE_STATIC_MODULE_FALSE@am__append_2 = lib mod bin t -@ENABLE_HAKGO_TRUE@bin_PROGRAMS = bin/hakgo$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ @@ -110,20 +108,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/hak-cfg.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am__bin_hakgo_SOURCES_DIST = hak.go hak-cb.go hak-inst.go bin/main.go \ - go.mod -am__dirstamp = $(am__leading_dot)dirstamp -@ENABLE_HAKGO_TRUE@am_bin_hakgo_OBJECTS = hak.$(OBJEXT) \ -@ENABLE_HAKGO_TRUE@ hak-cb.$(OBJEXT) hak-inst.$(OBJEXT) \ -@ENABLE_HAKGO_TRUE@ bin/main.$(OBJEXT) go.$(OBJEXT) -bin_hakgo_OBJECTS = $(am_bin_hakgo_OBJECTS) -bin_hakgo_LDADD = $(LDADD) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -136,9 +120,8 @@ AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib -SOURCES = $(bin_hakgo_SOURCES) -DIST_SOURCES = $(am__bin_hakgo_SOURCES_DIST) +SOURCES = +DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -375,22 +358,9 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = t t/test-bi.hak SUBDIRS = $(am__append_1) $(am__append_2) DIST_SUBDIRS = $(SUBDIRS) pas -@ENABLE_HAKGO_TRUE@bin_hakgo_SOURCES = \ -@ENABLE_HAKGO_TRUE@ hak.go \ -@ENABLE_HAKGO_TRUE@ hak-cb.go \ -@ENABLE_HAKGO_TRUE@ hak-inst.go \ -@ENABLE_HAKGO_TRUE@ bin/main.go \ -@ENABLE_HAKGO_TRUE@ go.mod - -@ENABLE_HAKGO_TRUE@bin_hakgo_DEPENDENCIES = hakgo.bin -@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_FALSE@CGO_CFLAGS_EXTRA = "" -@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_TRUE@CGO_CFLAGS_EXTRA = "-static" -@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_FALSE@CGO_LDFLAGS_EXTRA = "" -@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_TRUE@CGO_LDFLAGS_EXTRA = "-static" all: all-recursive .SUFFIXES: -.SUFFIXES: .go .mod .o am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @@ -424,75 +394,12 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files - -clean-binPROGRAMS: - $(am__rm_f) $(bin_PROGRAMS) - test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) -bin/$(am__dirstamp): - @$(MKDIR_P) bin - @: >>bin/$(am__dirstamp) -bin/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) bin/$(DEPDIR) - @: >>bin/$(DEPDIR)/$(am__dirstamp) -bin/main.$(OBJEXT): bin/$(am__dirstamp) bin/$(DEPDIR)/$(am__dirstamp) - -@ENABLE_HAKGO_FALSE@bin/hakgo$(EXEEXT): $(bin_hakgo_OBJECTS) $(bin_hakgo_DEPENDENCIES) $(EXTRA_bin_hakgo_DEPENDENCIES) bin/$(am__dirstamp) -@ENABLE_HAKGO_FALSE@ @rm -f bin/hakgo$(EXEEXT) -@ENABLE_HAKGO_FALSE@ $(AM_V_CCLD)$(LINK) $(bin_hakgo_OBJECTS) $(bin_hakgo_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f bin/*.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs - -rm -rf bin/.libs bin/_libs distclean-libtool: -rm -f libtool config.lt @@ -808,12 +715,9 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile $(PROGRAMS) +all-am: Makefile installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -840,22 +744,19 @@ clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) - -$(am__rm_f) bin/$(DEPDIR)/$(am__dirstamp) - -$(am__rm_f) bin/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-local distclean-tags +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-local distclean-tags dvi: dvi-recursive @@ -875,7 +776,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: install-html: install-html-recursive @@ -905,8 +806,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool +mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive @@ -916,28 +816,26 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-binPROGRAMS \ - clean-cscope clean-generic clean-libtool clean-local cscope \ - cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-bzip3 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip dist-zstd distcheck distclean distclean-compile \ - distclean-generic distclean-libtool distclean-local \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool clean-local cscope cscopelist-am ctags ctags-am \ + dist dist-all dist-bzip2 dist-bzip3 dist-gzip dist-lzip \ + dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ + distclean distclean-generic distclean-libtool distclean-local \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am .PRECIOUS: Makefile @@ -949,22 +847,6 @@ clean-local: rm -rf $(builddir)/go.mod $(builddir)/go.sum go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod -cache -@ENABLE_HAKGO_TRUE@bin/hakgo$(EXEEXT): lib/libhak.la $(hakgo_OBJECTS) -@ENABLE_HAKGO_TRUE@ cp -pf $(srcdir)/go.mod $(builddir)/go.mod >/dev/null 2>&1 || true -@ENABLE_HAKGO_TRUE@ chmod u+w $(builddir)/go.mod ## with `make distcheck`, the echo's redirection to the file fails without this permission change -@ENABLE_HAKGO_TRUE@ [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true -@ENABLE_HAKGO_TRUE@ CC=$(CC) \ -@ENABLE_HAKGO_TRUE@ CGO_CFLAGS="-I$(abs_srcdir)/lib -I$(abs_builddir)/lib $(CFLAGS) $(CGO_CFLAGS_EXTRA)" \ -@ENABLE_HAKGO_TRUE@ CGO_LDFLAGS="-L$(abs_builddir)/lib -L$(abs_builddir)/lib/.libs -lhak -ldl $(LIBM) $(CGO_LDFLAGS_EXTRA)" \ -@ENABLE_HAKGO_TRUE@ go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/$@ -modfile $(abs_builddir)/go.mod $(abs_srcdir)/bin/main.go -@ENABLE_HAKGO_TRUE@ go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod - -@ENABLE_HAKGO_TRUE@.go.o: -@ENABLE_HAKGO_TRUE@ echo $< > $@ - -@ENABLE_HAKGO_TRUE@.mod.o: -@ENABLE_HAKGO_TRUE@ echo $< > $@ - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/bin/Makefile.am b/bin/Makefile.am index 4fa8462..26b5d7f 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -70,10 +70,12 @@ hak_SOURCES = hak.c hak_CPPFLAGS = $(CPPFLAGS_COMMON) hak_LDFLAGS = $(LDFLAGS_COMMON) hak_LDADD = ../lib/libhak.la $(LIBADD_COMMON) +hak_DEPENDENCIES = ../lib/libhak.la if ENABLE_ISOCLINE hak_CPPFLAGS += -I$(srcdir)/isocline/include -DHAVE_ISOCLINE_H -DHAVE_ISOCLINE_LIB hak_LDADD += ./libisocline.a +hak_DEPENDENCIES += ./libisocline.a endif if ENABLE_HAKX @@ -83,5 +85,60 @@ hakx_SOURCES = hakx.c hakx_CPPFLAGS = $(CPPFLAGS_COMMON) hakx_LDFLAGS = $(LDFLAGS_COMMON) hakx_LDADD = ../lib/libhakx.la $(LIBADD_COMMON) +hakx_DEPENDENCIES = ../lib/libhakx.la endif + +if ENABLE_HAKGO + +## the attempt to compose a proper procedure using a regular compiler failed. +## e.g ./configure GOC=opt/go/pkg/tool/linux_amd64/ +## while go.m4 is included in autoconf 2.71, the support for the go language +## is very limited and the go language itself is pursuing the module based builder. +## +## the following is to trick autoconf/automake as if it's building go files with +## a real compiler whereas the actual building is done thru `go build` + +bin_PROGRAMS += hakgo +hakgo_SOURCES = \ + ../go.mod \ + ../hak.go \ + ../hak-cb.go \ + ../hak-inst.go \ + main.go +##hakgo_DEPENDENCIES = + +## let the linker to move hakgo.bin to the actual target +##hakgo_LINK = mv -f hakgo.bin hakgo$(EXEEXT) || echo "FAILED TO LINK" +hakgo_LINK = + +if ENABLE_STATIC +CGO_CFLAGS_EXTRA="-static" +CGO_LDFLAGS_EXTRA="-static" +else +CGO_CFLAGS_EXTRA="" +CGO_LDFLAGS_EXTRA="" +endif + +hakgo$(EXEEXT): ../lib/libhak.la $(hakgo_OBJECTS) + cp -pf $(top_srcdir)/go.mod $(builddir)/go.mod >/dev/null 2>&1 || true + chmod u+w $(builddir)/go.mod ## with `make distcheck`, the echo's redirection to the file fails without this permission change + [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true + ## --------------------------------------------------------------- + CC=$(CC) \ + CGO_CFLAGS="-I$(abs_top_srcdir)/lib -I$(abs_top_builddir)/lib $(CFLAGS) $(CGO_CFLAGS_EXTRA)" \ + CGO_LDFLAGS="-L$(abs_top_builddir)/lib -L$(abs_top_builddir)/lib/.libs -lhak -ldl $(LIBM) $(CGO_LDFLAGS_EXTRA)" \ + go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/$@ -modfile $(abs_builddir)/go.mod $(abs_srcdir)/main.go + ## --------------------------------------------------------------- + go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod + +## the go to o recipe is fake to deceive make +.go.o: + echo $< > $@ + +.mod.o: + echo $< > $@ + +endif + + diff --git a/bin/Makefile.in b/bin/Makefile.in index 1de184a..c04cb27 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -98,10 +98,12 @@ host_triplet = @host@ ################################################## @ENABLE_LIBLTDL_TRUE@am__append_1 = $(LTDL_LIBS) @ENABLE_LIBLTDL_FALSE@am__append_2 = $(DL_LIBS) -bin_PROGRAMS = hak$(EXEEXT) $(am__EXEEXT_1) +bin_PROGRAMS = hak$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) @ENABLE_ISOCLINE_TRUE@am__append_3 = -I$(srcdir)/isocline/include -DHAVE_ISOCLINE_H -DHAVE_ISOCLINE_LIB @ENABLE_ISOCLINE_TRUE@am__append_4 = ./libisocline.a -@ENABLE_HAKX_TRUE@am__append_5 = hakx +@ENABLE_ISOCLINE_TRUE@am__append_5 = ./libisocline.a +@ENABLE_HAKX_TRUE@am__append_6 = hakx +@ENABLE_HAKGO_TRUE@am__append_7 = hakgo subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ @@ -118,6 +120,7 @@ CONFIG_HEADER = $(top_builddir)/lib/hak-cfg.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @ENABLE_HAKX_TRUE@am__EXEEXT_1 = hakx$(EXEEXT) +@ENABLE_HAKGO_TRUE@am__EXEEXT_2 = hakgo$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) @@ -162,8 +165,6 @@ am__DEPENDENCIES_1 = @ENABLE_LIBLTDL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @ENABLE_LIBLTDL_FALSE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_4 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) -hak_DEPENDENCIES = ../lib/libhak.la $(am__DEPENDENCIES_4) \ - $(am__append_4) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -171,11 +172,16 @@ am__v_lt_1 = hak_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(hak_LDFLAGS) $(LDFLAGS) -o $@ +am__hakgo_SOURCES_DIST = ../go.mod ../hak.go ../hak-cb.go \ + ../hak-inst.go main.go +@ENABLE_HAKGO_TRUE@am_hakgo_OBJECTS = ../go.$(OBJEXT) ../hak.$(OBJEXT) \ +@ENABLE_HAKGO_TRUE@ ../hak-cb.$(OBJEXT) ../hak-inst.$(OBJEXT) \ +@ENABLE_HAKGO_TRUE@ main.$(OBJEXT) +hakgo_OBJECTS = $(am_hakgo_OBJECTS) +hakgo_LDADD = $(LDADD) am__hakx_SOURCES_DIST = hakx.c @ENABLE_HAKX_TRUE@am_hakx_OBJECTS = hakx-hakx.$(OBJEXT) hakx_OBJECTS = $(am_hakx_OBJECTS) -@ENABLE_HAKX_TRUE@hakx_DEPENDENCIES = ../lib/libhakx.la \ -@ENABLE_HAKX_TRUE@ $(am__DEPENDENCIES_4) hakx_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(hakx_LDFLAGS) $(LDFLAGS) -o $@ @@ -229,9 +235,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libisocline_a_SOURCES) $(hak_SOURCES) $(hakx_SOURCES) +SOURCES = $(libisocline_a_SOURCES) $(hak_SOURCES) $(hakgo_SOURCES) \ + $(hakx_SOURCES) DIST_SOURCES = $(am__libisocline_a_SOURCES_DIST) $(hak_SOURCES) \ - $(am__hakx_SOURCES_DIST) + $(am__hakgo_SOURCES_DIST) $(am__hakx_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -465,14 +472,28 @@ hak_SOURCES = hak.c hak_CPPFLAGS = $(CPPFLAGS_COMMON) $(am__append_3) hak_LDFLAGS = $(LDFLAGS_COMMON) hak_LDADD = ../lib/libhak.la $(LIBADD_COMMON) $(am__append_4) +hak_DEPENDENCIES = ../lib/libhak.la $(am__append_5) @ENABLE_HAKX_TRUE@hakx_SOURCES = hakx.c @ENABLE_HAKX_TRUE@hakx_CPPFLAGS = $(CPPFLAGS_COMMON) @ENABLE_HAKX_TRUE@hakx_LDFLAGS = $(LDFLAGS_COMMON) @ENABLE_HAKX_TRUE@hakx_LDADD = ../lib/libhakx.la $(LIBADD_COMMON) +@ENABLE_HAKX_TRUE@hakx_DEPENDENCIES = ../lib/libhakx.la +@ENABLE_HAKGO_TRUE@hakgo_SOURCES = \ +@ENABLE_HAKGO_TRUE@ ../go.mod \ +@ENABLE_HAKGO_TRUE@ ../hak.go \ +@ENABLE_HAKGO_TRUE@ ../hak-cb.go \ +@ENABLE_HAKGO_TRUE@ ../hak-inst.go \ +@ENABLE_HAKGO_TRUE@ main.go + +@ENABLE_HAKGO_TRUE@hakgo_LINK = +@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_FALSE@CGO_CFLAGS_EXTRA = "" +@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_TRUE@CGO_CFLAGS_EXTRA = "-static" +@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_FALSE@CGO_LDFLAGS_EXTRA = "" +@ENABLE_HAKGO_TRUE@@ENABLE_STATIC_TRUE@CGO_LDFLAGS_EXTRA = "-static" all: all-am .SUFFIXES: -.SUFFIXES: .c .lo .o .obj +.SUFFIXES: .c .go .lo .mod .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -596,6 +617,20 @@ libisocline.a: $(libisocline_a_OBJECTS) $(libisocline_a_DEPENDENCIES) $(EXTRA_li hak$(EXEEXT): $(hak_OBJECTS) $(hak_DEPENDENCIES) $(EXTRA_hak_DEPENDENCIES) @rm -f hak$(EXEEXT) $(AM_V_CCLD)$(hak_LINK) $(hak_OBJECTS) $(hak_LDADD) $(LIBS) +../$(am__dirstamp): + @$(MKDIR_P) .. + @: >>../$(am__dirstamp) +../$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ../$(DEPDIR) + @: >>../$(DEPDIR)/$(am__dirstamp) +../go.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) +../hak.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) +../hak-cb.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) +../hak-inst.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) + +@ENABLE_HAKGO_FALSE@hakgo$(EXEEXT): $(hakgo_OBJECTS) $(hakgo_DEPENDENCIES) $(EXTRA_hakgo_DEPENDENCIES) +@ENABLE_HAKGO_FALSE@ @rm -f hakgo$(EXEEXT) +@ENABLE_HAKGO_FALSE@ $(AM_V_GEN)$(hakgo_LINK) $(hakgo_OBJECTS) $(hakgo_LDADD) $(LIBS) hakx$(EXEEXT): $(hakx_OBJECTS) $(hakx_DEPENDENCIES) $(EXTRA_hakx_DEPENDENCIES) @rm -f hakx$(EXEEXT) @@ -603,6 +638,7 @@ hakx$(EXEEXT): $(hakx_OBJECTS) $(hakx_DEPENDENCIES) $(EXTRA_hakx_DEPENDENCIES) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f ../*.$(OBJEXT) -rm -f isocline/src/*.$(OBJEXT) distclean-compile: @@ -809,6 +845,8 @@ clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) ../$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) ../$(am__dirstamp) -$(am__rm_f) isocline/src/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) isocline/src/$(am__dirstamp) @@ -940,6 +978,22 @@ uninstall-am: uninstall-binPROGRAMS .PRECIOUS: Makefile +@ENABLE_HAKGO_TRUE@hakgo$(EXEEXT): ../lib/libhak.la $(hakgo_OBJECTS) +@ENABLE_HAKGO_TRUE@ cp -pf $(top_srcdir)/go.mod $(builddir)/go.mod >/dev/null 2>&1 || true +@ENABLE_HAKGO_TRUE@ chmod u+w $(builddir)/go.mod ## with `make distcheck`, the echo's redirection to the file fails without this permission change +@ENABLE_HAKGO_TRUE@ [ -f $(srcdir)/go.sum ] && cp -pf $(srcdir)/go.sum $(builddir)/go.sum >/dev/null 2>&1 || true +@ENABLE_HAKGO_TRUE@ CC=$(CC) \ +@ENABLE_HAKGO_TRUE@ CGO_CFLAGS="-I$(abs_top_srcdir)/lib -I$(abs_top_builddir)/lib $(CFLAGS) $(CGO_CFLAGS_EXTRA)" \ +@ENABLE_HAKGO_TRUE@ CGO_LDFLAGS="-L$(abs_top_builddir)/lib -L$(abs_top_builddir)/lib/.libs -lhak -ldl $(LIBM) $(CGO_LDFLAGS_EXTRA)" \ +@ENABLE_HAKGO_TRUE@ go build -C $(srcdir) -ldflags "-X 'main.BINDIR=$(bindir)' -X 'main.SBINDIR=$(sbindir)' -X 'main.LIBDIR=$(libdir)' -X 'main.SYSCONFDIR=$(sysconfdir)'" -x -o $(abs_builddir)/$@ -modfile $(abs_builddir)/go.mod $(abs_srcdir)/main.go +@ENABLE_HAKGO_TRUE@ go clean -C $(srcdir) -x -modfile $(abs_builddir)/go.mod + +@ENABLE_HAKGO_TRUE@.go.o: +@ENABLE_HAKGO_TRUE@ echo $< > $@ + +@ENABLE_HAKGO_TRUE@.mod.o: +@ENABLE_HAKGO_TRUE@ echo $< > $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: