##-*- makefile -*-############################################################
#
#  System        : 
#  Module        : 
#  Object Name   : $RCSfile$
#  Revision      : $Revision$
#  Date          : $Date$
#  Author        : $Author$
#  Created By    : Dr. Detlef Groth
#  Created       : Sun Apr 19 09:56:29 2020
#  Last Modified : <200419.1108>
#
#  Description	
#
#  Notes
#
#  History
#	
#  $Log$
#
##############################################################################
#
#  Copyright (c) 2020 Dr. Detlef Groth.
# 
#  All Rights Reserved.
# 
#  This  document  may  not, in  whole  or in  part, be  copied,  photocopied,
#  reproduced,  translated,  or  reduced to any  electronic  medium or machine
#  readable form without prior written consent from Dr. Detlef Groth.
#
##############################################################################
# API: https://www.cairographics.org/manual/index-all.html
# Wiki: 
OS=$(shell uname -o | sed -E 's:.+/|::')
default:
	make $(OS)
	
Linux:
	swig -tcl -namespace cairo.i 
	gcc -shared -fPIC -DUSE_TCL_STUBS -I/usr/include/cairo -I/opt/tcl/include cairo_wrap.c -o libcairo2.so -lcairo -L/opt/tcl/lib -ltclstub8.6

Msys:
	# msys:  pacman -S mingw-w64-x86_64-gtk3
	# msys: pacman -S mingw-w64-x86_64-swig
	# cp ../../../mingw64/bin/mingw32-make.exe ../../../mingw64/bin/make.exe
	swig -tcl -namespace mingw64-cairo.i 
	gcc -shared -DUSE_TCL_STUBS mingw64-cairo_wrap.c -I../../../mingw64/include/cairo \
           -ltclstub86 -lcairo -olibcairo.dll
	# gcc -shared -DUSE_TCL_STUBS  \
	# -I/opt/tcl/include -I/src/libcairo/include/cairo/ cairo_wrap.c \
	# -L/opt/tcl/lib -ltclstub84 -L/src/libcairo/lib/ -lcairo -olibcairo01.dll
test:
	wish cairo-test.tcl

