-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
30 lines (21 loc) · 825 Bytes
/
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
EMACS = emacs
MINGW_CC = x86_64-w64-mingw32-gcc
CFLAGS = -std=c99 -s -Wall -Wextra -O3 -fpic
LDFLAGS = -lsodium
MODULE_SUFFIX := $(shell $(EMACS) -batch --eval '(princ module-file-suffix)')
all: libsodium.so sodium.elc
linux: libsodium.so sodium.elc
windows: libsodium.dll sodium.elc
libsodium.so: libsodium.c
$(CC) -shared $(CFLAGS) $^ $(LDFLAGS) -o $@
libsodium.dll: libsodium.c
$(MINGW_CC) -shared $(CFLAGS) $(LCDFLAGS) -o $@ $^
sodium.elc: sodium.el
$(EMACS) -Q -batch -L . -f batch-byte-compile $<
sodium-box-demo.elc: sodium-box-demo.el
$(EMACS) -Q -batch -L . -f batch-byte-compile $<
box-demo: sodium-box-demo.elc sodium.elc libsodium$(MODULE_SUFFIX)
$(EMACS) -Q -L . -l $< -f sodium-box-demo
clean:
$(RM) libsodium.so libsodium.dll sodium.elc sodium-box-demo.elc
.PHONY: clean all linux windows