This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
71 lines (55 loc) · 2.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
TARGET=bim
CFLAGS ?=-g -O2 -std=gnu11 -Wvla -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-result
LDFLAGS ?=-rdynamic
CFLAGS += $(shell docs/git-tag)
ifeq (Darwin,$(shell uname -s))
LDLIBS=/usr/local/lib/libkuroko.a
else
LDLIBS=-l:libkuroko.a
endif
ifeq (klange,$(shell echo $$USER))
CFLAGS += -I../kuroko/src
LDLIBS=../kuroko/libkuroko.a
endif
LDLIBS += -ldl -lpthread
prefix=/usr/local
exec_prefix=$(prefix)
bindir=$(exec_prefix)/bin
datarootdir=$(prefix)/share
datadir=$(datarootdir)
INSTALL=install
INSTALL_PROGRAM=$(INSTALL)
INSTALL_DATA=$(INSTALL) -m 644
.PHONY: all clean distclean install install-strip uninstall
all: $(TARGET)
*.o: bim.h
bim: bim.o
clean:
-rm -f $(TARGET) bim.o
distclean: clean
install: all
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/$(TARGET)
mkdir -p $(DESTDIR)$(datadir)/bim/themes
$(INSTALL_DATA) themes/*.krk $(DESTDIR)$(datadir)/bim/themes/
mkdir -p $(DESTDIR)$(datadir)/bim/syntax
$(INSTALL_DATA) syntax/*.krk $(DESTDIR)$(datadir)/bim/syntax/
mkdir -p $(DESTDIR)$(datadir)/bim/site
$(INSTALL_DATA) site/*.krk $(DESTDIR)$(datadir)/bim/site/
install-strip: all
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
uninstall:
rm -f $(DESTDIR)$(bindir)/$(TARGET)
.PHONY: tags
tags:
ctags --c-kinds=+lx bim.c bim.h syntax/*
# Action definitions create functions with the same name
ctags --langdef=bim --language-force=bim --regex-bim='/^BIM_ACTION.([a-zA-Z_]*),/\1/f/' --append bim.c
# Command definitions are prefixed with bim_command_
ctags --langdef=bim --language-force=bim --regex-bim='/^BIM_COMMAND.([a-zA-Z_]*),/bim_command_\1/f/' --append bim.c
ctags --langdef=bim --language-force=bim --regex-bim='/^BIM_PREFIX_COMMAND.([a-zA-Z_]*),/bim_command_\1/f/' --append bim.c
# Flexible arrays create arrays, functions, count, and space objects
ctags --langdef=bim --language-force=bim --regex-bim='/^FLEXIBLE_ARRAY.([a-zA-Z_]*),/\1/v/' --append bim.c
ctags --langdef=bim --language-force=bim --regex-bim='/^FLEXIBLE_ARRAY.[a-zA-Z_]*,([a-zA-Z_]*),/\1/f/' --append bim.c
ctags --langdef=bim --language-force=bim --regex-bim='/^FLEXIBLE_ARRAY.([a-zA-Z_]*),/flex_\1_count/v/' --append bim.c
ctags --langdef=bim --language-force=bim --regex-bim='/^FLEXIBLE_ARRAY.([a-zA-Z_]*),/flex_\1_space/v/' --append bim.c