#############################################################################
#
# Makefile for Amiga Python GUI module Example
#
#############################################################################

MODULE := guimodule.so

#############################################################################

INCLUDES := -I/SDK/Local/newlib/include/python2.5
LIBS     := -L/SOBJS -lpython25
COPTS    := -std=c99 -mcrt=newlib -O2 -gstabs -Wall -Werror

#############################################################################

#
# Copy our new module directly into the Amiga Python directory tree
#
# Note we have to use POSIX paths in the Makefile but we use a DOS
# command to copy the file so we use make's built-in path conversion
# function to make this easy.
#

/PYTHON/Lib/lib-dynload/guimodule.so: guimodule.so
	Copy $^ $(amigapath $@) CLONE

#############################################################################

guimodule.so: guimodule.o
	gcc -shared $(COPTS) -o $@ $^ $(LIBS) -Wl,-Map=$@.map

#############################################################################

guimodule.o: guimodule.c
	gcc -fPIC $(COPTS) $(INCLUDES) -c -o $@ $^
