Δ Γ Λ Ω Φ Ψ Σ Θ answered only to De, Ga, La, Om, Ph, Ps, Si, Th, while their small letters answered to delta, gamma and the rest; they answer to the names too now. mkemoji and cldr2emoji write UTF-8 whatever the locale, as the other generators already did; verify-map calls python3 the one way; the tests' include path drops a directory nothing includes through; and bench.sh says which binary is missing instead of blaming the daemon ten seconds later.
102 lines
2.9 KiB
Makefile
102 lines
2.9 KiB
Makefile
CC = 9c
|
|
LD = 9l
|
|
PKG_CONFIG ?= pkg-config
|
|
CFLAGS ?= -O2 -g
|
|
WARN_CFLAGS = -Wall -Wextra
|
|
IBUS_CFLAGS = $(shell $(PKG_CONFIG) --cflags dbus-1 xkbcommon)
|
|
IBUS_LIBS = $(shell $(PKG_CONFIG) --libs dbus-1 xkbcommon)
|
|
XIM_CFLAGS = $(shell $(PKG_CONFIG) --cflags xcb-imdkit xcb-aux xcb-xkb xkbcommon-x11)
|
|
XIM_LIBS = $(shell $(PKG_CONFIG) --libs xcb-imdkit xcb-aux xcb-xkb xkbcommon-x11)
|
|
TEXT_CFLAGS = $(shell $(PKG_CONFIG) --cflags pangocairo cairo fontconfig)
|
|
TEXT_LIBS = $(shell $(PKG_CONFIG) --libs pangocairo cairo fontconfig)
|
|
POPUP_CFLAGS = $(shell $(PKG_CONFIG) --cflags xcb-aux xcb-randr)
|
|
POPUP_LIBS = $(shell $(PKG_CONFIG) --libs xcb-aux xcb-randr)
|
|
PROJECT_CPPFLAGS =
|
|
PROJECT_LDLIBS = -lthread -lbio -lxcb $(IBUS_LIBS) $(TEXT_LIBS) \
|
|
$(XIM_LIBS) $(POPUP_LIBS)
|
|
PROG = strans
|
|
DOCKER_IMAGE = strans-build
|
|
DOCKER_RUN = docker run --rm --user "$$(id -u):$$(id -g)" \
|
|
-v "$(CURDIR):/src" $(DOCKER_IMAGE)
|
|
|
|
SRCS = compose.c dict.c font.c ibus.c ipc.c ko.c main.c popup_layout.c \
|
|
srv.c str.c strans.c trie.c vi.c win.c xim.c
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
all: $(PROG) gtk
|
|
|
|
$(PROG): $(OBJS)
|
|
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(PROJECT_LDLIBS) $(LDLIBS)
|
|
|
|
$(OBJS): dat.h fn.h ipc.h
|
|
compose.o ibus.o: PROJECT_CPPFLAGS += $(IBUS_CFLAGS)
|
|
font.o: PROJECT_CPPFLAGS += $(TEXT_CFLAGS)
|
|
win.o: PROJECT_CPPFLAGS += $(POPUP_CFLAGS)
|
|
xim.o: PROJECT_CPPFLAGS += $(XIM_CFLAGS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CPPFLAGS) $(PROJECT_CPPFLAGS) $(WARN_CFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(PROG)
|
|
$(MAKE) -C tests clean
|
|
$(MAKE) -C gtk/ clean
|
|
$(MAKE) -C bench/ clean
|
|
|
|
gtk:
|
|
$(MAKE) -C gtk/
|
|
|
|
bench:
|
|
$(MAKE) -C bench/
|
|
|
|
docker-image: Dockerfile
|
|
docker build -t $(DOCKER_IMAGE) - < Dockerfile
|
|
|
|
docker-build:
|
|
$(DOCKER_RUN) sh -c 'make clean && make all'
|
|
|
|
docker-check:
|
|
$(DOCKER_RUN) sh -c 'make clean && \
|
|
make check check-live check-stress UNITARGS="$(UNITARGS)"'
|
|
|
|
docker-check-live:
|
|
$(DOCKER_RUN) sh -c 'make clean && make check-live'
|
|
|
|
docker-check-stress:
|
|
$(DOCKER_RUN) sh -c 'make clean && make check-stress'
|
|
|
|
docker-bench:
|
|
$(DOCKER_RUN) sh -c 'make clean && make bench'
|
|
|
|
docker-valgrind:
|
|
$(DOCKER_RUN) sh -c 'make clean && make -C tests unit_test && \
|
|
cd tests && valgrind -q --error-exitcode=1 ./unit_test $(UNITARGS)'
|
|
|
|
docker: docker-image
|
|
$(MAKE) docker-build
|
|
|
|
check: verify-map
|
|
$(MAKE) -C tests check UNITARGS="$(UNITARGS)"
|
|
|
|
check-live: $(PROG) gtk
|
|
$(MAKE) -C tests check-live
|
|
|
|
check-stress: $(PROG)
|
|
$(MAKE) -C tests check-stress
|
|
|
|
test: check
|
|
|
|
verify-map:
|
|
test "$$(cut -f1 map/hira.map)" = "$$(cut -f1 map/kata.map)"
|
|
python3 map/mktelex.py | cmp - map/telex.map
|
|
python3 map/mkemoji | cmp - map/emoji.dict
|
|
python3 map/mkhanja | cmp - map/hanja.dict
|
|
python3 map/verifymap.py map/*.map map/*.dict
|
|
python3 tests/mkemoji_test.py
|
|
python3 tests/mkhanja_test.py
|
|
python3 tests/skk2ktrans_test.py
|
|
|
|
.PHONY: all check check-live check-stress test verify-map clean gtk bench \
|
|
docker docker-image docker-build docker-check docker-check-live \
|
|
docker-check-stress docker-bench docker-valgrind
|