pastry
truetype font renderer
Makefile
1514 bytes raw
1CC = gcc
2DEMO_CFLAGS = $(shell pkg-config --cflags x11 xrender harfbuzz fribidi)
3DEMO_LIBS = $(shell pkg-config --libs x11 xrender harfbuzz fribidi)
4CFLAGS = -std=c99 -pedantic-errors -Wall -Wextra -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
5 -Wnested-externs -Winline -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-conversion \
6 -Wfloat-conversion -Wformat=2 -Wformat-security -Wformat-nonliteral -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wjump-misses-init \
7 -Wdouble-promotion -Wlogical-op -Wdangling-pointer -Wunreachable-code -Wshift-overflow=2 -Wswitch-enum -Wswitch-default \
8 -Wshift-negative-value -fno-builtin -fno-common -fstrict-aliasing -fstack-protector-strong -O2 -fno-omit-frame-pointer
9
10SRC = pastry.c
11OBJ = pastry.o
12LIB = libpastry.a
13HDR = pastry.h
14
15RELEASE_DIR = release
16INCLUDE_DIR = $(RELEASE_DIR)/include
17LIB_DIR = $(RELEASE_DIR)/lib
18
19all: $(LIB)
20
21$(LIB): $(OBJ)
22 @mkdir -p $(LIB_DIR)
23 ar rcs $(LIB_DIR)/$(LIB) $<
24 @echo "built $(LIB_DIR)/$(LIB)"
25
26$(OBJ): $(SRC) $(HDR)
27 @mkdir -p $(INCLUDE_DIR)
28 cp $(HDR) $(INCLUDE_DIR)/
29 $(CC) $(CFLAGS) -c $< -o $@
30
31# the demo resolves the bidi order with fribidi, shapes with harfbuzz, and draws with pastry
32demo: demo.c $(SRC) $(HDR)
33 $(CC) -std=c99 -O2 -Wall -Wextra $(DEMO_CFLAGS) demo.c $(SRC) -o $@ $(DEMO_LIBS)
34
35clean:
36 rm -rf $(RELEASE_DIR)
37 rm -f $(OBJ) demo
38
39.PHONY: all clean