λ

pastry

truetype font renderer

settings

Makefile

1514 bytes raw

CC = gcc
DEMO_CFLAGS     = $(shell pkg-config --cflags x11 xrender harfbuzz fribidi)
DEMO_LIBS       = $(shell pkg-config --libs x11 xrender harfbuzz fribidi)
CFLAGS = -std=c99 -pedantic-errors -Wall -Wextra -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls  \
             -Wnested-externs -Winline -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-conversion \
             -Wfloat-conversion -Wformat=2 -Wformat-security -Wformat-nonliteral -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wjump-misses-init     \
             -Wdouble-promotion -Wlogical-op -Wdangling-pointer -Wunreachable-code -Wshift-overflow=2 -Wswitch-enum -Wswitch-default            \
             -Wshift-negative-value -fno-builtin -fno-common -fstrict-aliasing -fstack-protector-strong -O2 -fno-omit-frame-pointer

SRC = pastry.c
OBJ = pastry.o
LIB = libpastry.a
HDR = pastry.h

RELEASE_DIR = release
INCLUDE_DIR = $(RELEASE_DIR)/include
LIB_DIR = $(RELEASE_DIR)/lib

all: $(LIB)

$(LIB): $(OBJ)
	@mkdir -p $(LIB_DIR)
	ar rcs $(LIB_DIR)/$(LIB) $<
	@echo "built $(LIB_DIR)/$(LIB)"

$(OBJ): $(SRC) $(HDR)
	@mkdir -p $(INCLUDE_DIR)
	cp $(HDR) $(INCLUDE_DIR)/
	$(CC) $(CFLAGS) -c $< -o $@

# the demo resolves the bidi order with fribidi, shapes with harfbuzz, and draws with pastry
demo: demo.c $(SRC) $(HDR)
	$(CC) -std=c99 -O2 -Wall -Wextra $(DEMO_CFLAGS) demo.c $(SRC) -o $@ $(DEMO_LIBS)

clean:
	rm -rf $(RELEASE_DIR)
	rm -f $(OBJ) demo

.PHONY: all clean