# Makefile for examples/embed.c
#
# libpython3.14.a was built with GCC 9, and Python 3.14's headers need
# GCC >= 4.8 (C11 atomics).  On MorphOS the plain "ppc-morphos-gcc" is the
# SDK's compiler selector (ENV:GCCSelect) and may still be GCC 2.95.3, so
# GCC 9 is called by its explicit name, which exists both natively in
# the SDK 3.20 (GG:bin, gcc9 pack) and in the Linux cross SDK.
#
#   make                         (GCC 9: ppc-morphos-gcc-9)
#   make CC=ppc-morphos-gcc-15   (another modern GCC)
PYDEV ?= ..
include $(PYDEV)/python-embed.mk

CC     = ppc-morphos-gcc-9
STRIP  = ppc-morphos-strip
CFLAGS = -O2 -Wall $(PY_CFLAGS)

all: embed

embed: embed.o
	$(CC) $(PY_LDFLAGS) -o embed embed.o $(PY_LIBS)
	$(STRIP) --strip-unneeded --remove-section=.comment embed

embed.o: embed.c
	$(CC) $(CFLAGS) -c embed.c -o embed.o

clean:
	-delete embed embed.o QUIET
	-rm -f embed embed.o

.PHONY: all clean
