# makefile for pthread example.

# Copyright (c) 1994-2021 by Marc Feeley, All Rights Reserved.

herefromroot = examples/pthread
rootfromhere = ../..
SUBDIRS =

PACKAGE_SHORTNAME = gambit
PACKAGE_NAME = Gambit
PACKAGE_VERSION = v4.9.7
PACKAGE_STRING = Gambit v4.9.7
PACKAGE_BUGREPORT = gambit@iro.umontreal.ca
PACKAGE_TARNAME = gambit-v4_9_7



srcdir = .

srcdirpfx = 

C_COMPILER = gcc
C_PREPROC = gcc -E
FLAGS_OBJ = -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection    -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-trapping-math -fno-math-errno -fschedule-insns2 -foptimize-sibling-calls -fomit-frame-pointer -fipa-ra -fmove-loop-invariants -fPIC -fno-common -mpc64  
FLAGS_DYN = -Wl,-z,relro -Wl,-z,now -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection    -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-trapping-math -fno-math-errno -fschedule-insns2 -foptimize-sibling-calls -fomit-frame-pointer -fipa-ra -fmove-loop-invariants -fPIC -fno-common -mpc64    -rdynamic -shared
FLAGS_LIB = -Wl,-z,relro -Wl,-z,now -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection      -rdynamic -shared -Wl,-soname,$(LIBRARY)$(LIB_MAJOR_VERSION_SUFFIX)
FLAGS_EXE = -Wl,-z,relro -Wl,-z,now -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection    -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-trapping-math -fno-math-errno -fschedule-insns2 -foptimize-sibling-calls -fomit-frame-pointer -fipa-ra -fmove-loop-invariants -fPIC -fno-common -mpc64     -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-trapping-math -fno-math-errno -fschedule-insns2 -foptimize-sibling-calls -fomit-frame-pointer -fipa-ra -fmove-loop-invariants -fPIC -fno-common -mpc64    -rdynamic
FLAGS_OPT =  -O1 -fexpensive-optimizations -fno-gcse --param max-gcse-memory=400000
FLAGS_OPT_RTS =  -O3
DEFS = -DHAVE_CONFIG_H
LIBS = -lm   -L/usr/local/opt/openssl/lib -lssl -lcrypto

GAMBITLIB_DEFS =  -D___GAMBITDIR="\"/usr\"" -D___GAMBITDIR_LIB="\"${prefix}/lib/x86_64-linux-gnu/gambit\"" -D___GAMBITDIR_INFO="\"${prefix}/share/info\"" -D___GAMBITDIR_USERLIB="\"\176/.gambit_userlib\"" -D___GAMBITDIR_INSTLIB="\"\176\176userlib\"" -D___SYS_TYPE_CPU="\"x86_64\"" -D___SYS_TYPE_VENDOR="\"pc\"" -D___SYS_TYPE_OS="\"linux-gnu\"" -D___CONFIGURE_COMMAND="\"./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--enable-single-host' '--enable-trust-c-tco' '--enable-dynamic-clib' '--enable-shared' '--disable-absolute-shared-libs' '--enable-versioned-shared-libs' '--enable-openssl' '--libdir=${prefix}/lib/x86_64-linux-gnu/gambit' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection'"\" -D___OBJ_EXTENSION="\".o\"" -D___EXE_EXTENSION="\"\"" -D___BAT_EXTENSION="\"\""
LIB_PREFIX = lib
LIB_VERSION_SUFFIX = .4.9.7
LIB_MAJOR_VERSION_SUFFIX = .4

LIB_EXTENSION = .so
GAMBITLIB = gambit
GAMBITGSCLIB = gambitgsc
GAMBITGSILIB = gambitgsi
INSTALL = $(rootfromhere)/install-sh -c
INSTALL_DATA = $(rootfromhere)/install-sh -c -m 644
INSTALL_LIB = $(rootfromhere)/install-sh -c -m 644
INSTALL_PROGRAM = $(rootfromhere)/install-sh -c -m 755
LN_S = ln -s
RANLIB = ranlib
AR = ar
RC = git
GIT = git
HG = hg

prefix = /usr
exec_prefix = ${prefix}
includedir = ${prefix}/include
libdir = ${prefix}/lib/x86_64-linux-gnu/gambit
bindir = ${prefix}/bin
docdir = ${prefix}/doc
infodir = ${prefix}/share/info
emacsdir = ${datadir}/emacs/site-lisp
libexecdir = ${exec_prefix}/libexec
datarootdir = ${prefix}/share
datadir = ${prefix}/share
htmldir = ${docdir}
dvidir = ${docdir}
pdfdir = ${docdir}
psdir = ${docdir}
localedir = ${datarootdir}/locale
mandir = ${prefix}/share/man

.SUFFIXES: .scm .c .o

RCFILES = makefile.in README mylib.scm mylib.h pthread.c

GENDISTFILES =

DISTFILES = $(RCFILES) $(GENDISTFILES)

GAMBITDIR_INCLUDE = $(srcdirpfx)$(rootfromhere)/include
GAMBITDIR_LIB = $(srcdirpfx)$(rootfromhere)/lib
GAMBITDIR_LIB_GSI = $(srcdirpfx)$(rootfromhere)/gsi
GAMBITDIR_LIB_GSC = $(srcdirpfx)$(rootfromhere)/gsc

BUILD_OBJ_OUTPUT_FILENAME_PARAM = $*.o
BUILD_OBJ_CC_OPTIONS_PARAM =  -I$(srcdir) $(DEFS)
BUILD_OBJ_INPUT_FILENAMES_PARAM = $(srcdirpfx)$*.c

BUILD_EXE_OUTPUT_FILENAME_PARAM = $(EXECUTABLE)
BUILD_EXE_CC_OPTIONS_PARAM =
BUILD_EXE_LD_OPTIONS_PRELUDE_PARAM =
BUILD_EXE_INPUT_FILENAMES_PARAM = $(EXECUTABLE_OBJECTS)
BUILD_EXE_LD_OPTIONS_PARAM =

all: core

core:

core-pre:

core-post:

examples: run

run: pthread
	LD_LIBRARY_PATH=$(rootfromhere)/lib:$(rootfromhere)/gsi:$(rootfromhere)/gsc:${LD_LIBRARY_PATH} ./pthread

.c.o:
	${C_COMPILER} ${FLAGS_OPT} ${FLAGS_OBJ} ${DEFS_OBJ} -I"${GAMBITDIR_INCLUDE}" -c -o ${BUILD_OBJ_OUTPUT_FILENAME_PARAM} ${BUILD_OBJ_CC_OPTIONS_PARAM} ${BUILD_OBJ_INPUT_FILENAMES_PARAM} -D___LIBRARY

.scm.c:
	LD_LIBRARY_PATH=$(rootfromhere)/lib:$(rootfromhere)/gsi:$(rootfromhere)/gsc:${LD_LIBRARY_PATH} $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -warnings -c $(srcdirpfx)$*.scm

mylib_.c: mylib.c
	LD_LIBRARY_PATH=$(rootfromhere)/lib:$(rootfromhere)/gsi:$(rootfromhere)/gsc:${LD_LIBRARY_PATH} $(rootfromhere)/gsc/gsc -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -warnings -link -o mylib_.c mylib.c

pthread.o: pthread.c mylib.h $(srcdirpfx)$(rootfromhere)/include/gambit.h

pthread: mylib.o mylib_.o pthread.o
	$(MAKE) build_exe \
	  BUILD_EXE_OUTPUT_FILENAME_PARAM="pthread" \
	  BUILD_EXE_CC_OPTIONS_PARAM="" \
	  BUILD_EXE_LD_OPTIONS_PRELUDE_PARAM="" \
	  BUILD_EXE_INPUT_FILENAMES_PARAM="mylib.o mylib_.o pthread.o" \
	  BUILD_EXE_LD_OPTIONS_PARAM=""

build_exe:
	${C_COMPILER} ${FLAGS_EXE} ${DEFS_EXE} -I"${GAMBITDIR_INCLUDE}"  -o ${BUILD_EXE_OUTPUT_FILENAME_PARAM} ${BUILD_EXE_CC_OPTIONS_PARAM} ${BUILD_EXE_LD_OPTIONS_PRELUDE_PARAM} ${BUILD_EXE_INPUT_FILENAMES_PARAM} "${GAMBITDIR_LIB}/libgambit.so.4.9.7" ${LIBS} ${BUILD_EXE_LD_OPTIONS_PARAM}

bootstrap-pre:

bootstrap-post:

install-pre:

install-post: core

uninstall-pre:

uninstall-post:

select-gen-for-commit-pre:

select-gen-for-commit-post select-gen-for-commit-post-nonrec:

deselect-gen-for-commit-pre:

deselect-gen-for-commit-post deselect-gen-for-commit-post-nonrec:

mostlyclean-pre:

mostlyclean-post mostlyclean-post-nonrec:
	rm -f mylib.c mylib_.c mylib.o mylib_.o pthread.o pthread

clean-pre: mostlyclean-pre

clean-post clean-post-nonrec: mostlyclean-post-nonrec
	rm -f *.gcov *.gcno *.gcda

distclean-pre: clean-pre

distclean-post distclean-post-nonrec: clean-post-nonrec

bootclean-pre: distclean-pre

bootclean-post bootclean-post-nonrec: distclean-post-nonrec

realclean-pre: bootclean-pre

realclean-post realclean-post-nonrec: bootclean-post-nonrec
	rm -f makefile

rc-setup-pre:
	$(RC) add $(RCFILES)

rc-setup-post:

dist-pre dist-devel-pre:
	mkdir $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
	chmod 777 $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
	@echo "  Copying distribution files:"
	@for file in $(DISTFILES); do \
	  echo "    $(herefromroot)/$$file"; \
	  ln $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot) 2> /dev/null \
	    || cp -p $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot); \
	done

dist-post dist-devel-post:

core-recursive bootstrap-recursive install-recursive uninstall-recursive select-gen-for-commit-recursive deselect-gen-for-commit-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive:
	@if test -n "$(SUBDIRS)"; then \
	  for subdir in ""$(SUBDIRS); do \
	    target=`echo $@ | sed 's/-recursive//'`; \
	    echo making $$target in $$subdir; \
	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
	  done \
	fi

core: core-post

core-post: core-recursive

core-recursive: core-pre

bootstrap: bootstrap-post

bootstrap-post: bootstrap-recursive

bootstrap-recursive: bootstrap-pre

install: install-post

install-post: install-recursive

install-recursive: install-pre

uninstall: uninstall-post

uninstall-post: uninstall-recursive

uninstall-recursive: uninstall-pre

select-gen-for-commit: select-gen-for-commit-post

select-gen-for-commit-post: select-gen-for-commit-recursive

select-gen-for-commit-post-nonrec select-gen-for-commit-recursive: select-gen-for-commit-pre

deselect-gen-for-commit: deselect-gen-for-commit-post

deselect-gen-for-commit-post: deselect-gen-for-commit-recursive

deselect-gen-for-commit-post-nonrec deselect-gen-for-commit-recursive: deselect-gen-for-commit-pre

mostlyclean: mostlyclean-post

mostlyclean-post: mostlyclean-recursive

mostlyclean-post-nonrec mostlyclean-recursive: mostlyclean-pre

clean: clean-post

clean-post: clean-recursive

clean-post-nonrec clean-recursive: clean-pre

distclean: distclean-post

distclean-post: distclean-recursive

distclean-post-nonrec distclean-recursive: distclean-pre

bootclean: bootclean-post

bootclean-post: bootclean-recursive

bootclean-post-nonrec bootclean-recursive: bootclean-pre

realclean: realclean-post

realclean-post: realclean-recursive

realclean-post-nonrec realclean-recursive: realclean-pre

rc-setup: rc-setup-post

rc-setup-post: rc-setup-recursive

rc-setup-recursive: rc-setup-pre

dist: dist-post

dist-post: dist-recursive

dist-recursive: dist-pre

dist-devel: dist-devel-post

dist-devel-post: dist-devel-recursive

dist-devel-recursive: dist-devel-pre

makefile: makefile.in $(rootfromhere)/config.status
	cd $(rootfromhere) && CONFIG_FILES=$(herefromroot)/$@ CONFIG_HEADERS= ./config.status

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
