-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 684 Bytes
/
Makefile
File metadata and controls
43 lines (33 loc) · 684 Bytes
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
ifdef MODULE_FILE_SUFFIX
SUFFIX = $(MODULE_FILE_SUFFIX)
else
SUFFIX = .so
endif
TARGET = librime-emacs$(SUFFIX)
CC = gcc
ifdef DEBUG
CFLAGS = -fPIC -g -Wall
else
CFLAGS = -fPIC -O2 -Wall
endif
ifeq ($(SUFFIX), .dylib)
LDFLAGS = -dynamiclib
else
LDFLAGS = -shared
endif
ifdef LIBRIME_ROOT
CFLAGS += -I ${LIBRIME_ROOT}include/
LDFLAGS += -L ${LIBRIME_ROOT}lib/ -Wl,-rpath ${LIBRIME_ROOT}lib/ -lrime
else
LDFLAGS += -lrime
endif
ifdef EMACS_MODULE_HEADER_ROOT
CFLAGS += -I ${EMACS_MODULE_HEADER_ROOT}
endif
default: clean test
clean:
-rm -f $(TARGET)
lib:
$(CC) lib.c -o $(TARGET) $(CFLAGS) $(LDFLAGS)
test:
emacs -Q -L "$$(pwd)" -l test.el