Skip to content

Instantly share code, notes, and snippets.

@klange
Created December 30, 2016 13:48
Show Gist options
  • Save klange/dec6eaf54d70929953d2319e378c84ae to your computer and use it in GitHub Desktop.
Save klange/dec6eaf54d70929953d2319e378c84ae to your computer and use it in GitHub Desktop.
Makefile for building pycairo for ToaruOS

I have no idea how to cross-compile things with waf, but this is a pretty simple package. You can stick this Makefile in the src subdirectory from pycairo to build a working _cairo.so. Don't forget to write a cairo.py (from _cairo import *) as well.

CC = i686-pc-toaru-gcc
CFLAGS = -I${TOOLCHAIN}/python/include/python3.6m $(shell pkg-config --cflags cairo) -DVERSION='"1.10.1"' -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=10 -DPYCAIRO_VERSION_MICRO=1
OBJS = cairomodule.o context.o font.o matrix.o path.o pattern.o region.o surface.o
all: _cairo.so
$(OBJS):
_cairo.so: $(OBJS)
$(CC) -shared -o _cairo.so $(OBJS) -lpython3.6m -lcairo -lc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment