Artifact [6b6db780f5]

Artifact 6b6db780f58a44c8ceecea1b3fe56686158480658ffbc7fdbbf3bb631966ea7d:


CC            := @CC@
AR            := @AR@
RANLIB        := @RANLIB@
CFLAGS        := @CFLAGS@ @SHOBJFLAGS@
CPPFLAGS      := -I. -I@srcdir@ -I@srcdir@/tweetnacl/ -I@srcdir@/blake2b/ -DNACL_ED25519_BLAKE2B=1 @CPPFLAGS@ @SHOBJCPPFLAGS@ @DEFS@ @TCL_DEFS@
LDFLAGS       := @LDFLAGS@
LIBS          := @LIBS@
SHOBJLDFLAGS  := @SHOBJLDFLAGS@
VPATH         := @srcdir@
srcdir        := @srcdir@
prefix        := @prefix@
exec_prefix   := @exec_prefix@
libdir        := @libdir@
PACKAGE_VERSION     := @PACKAGE_VERSION@
TCL_PACKAGE_PATH    := @TCL_PACKAGE_PATH@
PACKAGE_INSTALL_DIR := $(TCL_PACKAGE_PATH)/tcl-nano$(PACKAGE_VERSION)
INSTALL             := @INSTALL@
INSTALL_PROGRAM     := @INSTALL_PROGRAM@
INSTALL_DATA        := @INSTALL_DATA@
export CC CFLAGS CPPFLAGS

all: @EXTENSION_TARGET@ pkgIndex.tcl

ifeq (@TCLEXT_BUILD@,shared)
@EXTENSION_TARGET@: tweetnacl.o blake2b.o randombytes.o nano.o Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o @EXTENSION_TARGET@ nano.o randombytes.o tweetnacl.o blake2b.o $(LIBS)
	-@WEAKENSYMS@ @EXTENSION_TARGET@
	-@REMOVESYMS@ @EXTENSION_TARGET@
else
@EXTENSION_TARGET@: nano-amalgamation.o Makefile
	-@WEAKENSYMS@ nano-amalgamation.o
	-@REMOVESYMS@ nano-amalgamation.o
	$(AR) rc @EXTENSION_TARGET@ nano-amalgamation.o
	-$(RANLIB) @EXTENSION_TARGET@
endif

# The amalgamation is used when compiling statically so that the same ABI can be exposed
# to upstream projects rather than requiring them to filter out our symbols
nano-amalgamation.c: @srcdir@/nano.c @srcdir@/randombytes.c @srcdir@/tweetnacl/tweetnacl.c @srcdir@/blake2b/blake2b.c Makefile
	rm -f nano-amalgamation.c
	cat @srcdir@/nano.c @srcdir@/randombytes.c @srcdir@/tweetnacl/tweetnacl.c @srcdir@/blake2b/blake2b.c > nano-amalgamation.c

nano-amalgamation.o: nano-amalgamation.c @srcdir@/tweetnacl/tweetnacl.h @srcdir@/blake2b/blake2.h @srcdir@/randombytes.h nano.tcl.h @srcdir@/blake2b/blake2-impl.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o nano-amalgamation.o -c nano-amalgamation.c

nano.o: @srcdir@/nano.c @srcdir@/tweetnacl/tweetnacl.h @srcdir@/blake2b/blake2.h @srcdir@/randombytes.h nano.tcl.h Makefile
	$(CC) $(CPPFLAGS) $(CFLAGS) -o nano.o -c @srcdir@/nano.c

randombytes.o: @srcdir@/randombytes.c @srcdir@/randombytes.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o randombytes.o -c @srcdir@/randombytes.c

tweetnacl.o: @srcdir@/tweetnacl/tweetnacl.c @srcdir@/tweetnacl/tweetnacl.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tweetnacl.o -c @srcdir@/tweetnacl/tweetnacl.c

blake2b.o: @srcdir@/blake2b/blake2b.c @srcdir@/blake2b/blake2.h @srcdir@/blake2b/blake2-impl.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o blake2b.o -c @srcdir@/blake2b/blake2b.c

pkgIndex.tcl: pkgIndex.tcl-@TCLEXT_BUILD@
	cp pkgIndex.tcl-@TCLEXT_BUILD@ pkgIndex.tcl

nano.tcl.h: @srcdir@/nano.tcl Makefile
	od -A n -v -t xC < '@srcdir@/nano.tcl' > nano.tcl.h.new.1
	sed 's@  *@@g;s@..@0x&, @g' < nano.tcl.h.new.1 > nano.tcl.h.new.2
	rm -f nano.tcl.h.new.1
	mv nano.tcl.h.new.2 nano.tcl.h

test: @EXTENSION_TARGET@ pkgIndex.tcl
	@srcdir@/build/test/test.tcl .

install: @EXTENSION_TARGET@ pkgIndex.tcl
	$(INSTALL) -d '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_PROGRAM) @EXTENSION_TARGET@ '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
	$(INSTALL_DATA)    pkgIndex.tcl '$(DESTDIR)$(PACKAGE_INSTALL_DIR)'
 
clean:
	rm -f nano-amalgamation.c nano-amalgamation.o
	rm -f @EXTENSION_TARGET@ nano.o
	rm -f blake2b.o tweetnacl.o randombytes.o

distclean: clean
	rm -f Makefile pkgIndex.tcl-shared pkgIndex.tcl-static nano.syms
	rm -f pkgIndex.tcl
	rm -f config.log config.status
	rm -f nano.tcl.h nano.tcl.h.new.1 nano.tcl.h.new.2

mrproper: distclean
	rm -f configure aclocal.m4 config.guess config.sub install-sh
	rm -f nano.vers
	rm -rf tweetnacl blake2b
	$(MAKE) -C build/tweetnacl distclean
	$(MAKE) -C build/blake2b distclean

.PHONY: all test clean distclean mrproper