-
Notifications
You must be signed in to change notification settings - Fork 11
/
makefile
36 lines (27 loc) · 707 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
31
32
33
34
35
36
NAME=sketchybar
CFLAGS=-std=c99 -O3 -g -shared -fPIC
INSTALL_DIR=$(HOME)/.local/share/sketchybar_lua
LUA_DIR=lua-5.4.7
LIBS=-I$(LUA_DIR)/src -Lbin -llua -framework CoreFoundation
ifeq ($(shell uname -sm),Darwin arm64)
ARCH= -arch arm64
else
ARCH= -arch x86_64
endif
bin/$(NAME).so: src/$(NAME).c src/*.c bin/liblua.a
clang $(CFLAGS) $(ARCH) $^ $(LIBS) -o bin/$(NAME).so
install: bin/$(NAME).so | $(INSTALL_DIR)
mkdir -p $(INSTALL_DIR)
mv bin/$(NAME).so $(INSTALL_DIR)
uninstall:
rm -rf $(INSTALL_DIR)/$(NAME).so
clean:
rm -rf bin
cd $(LUA_DIR) && make clean
bin/liblua.a: | bin
cd $(LUA_DIR) && make
mv $(LUA_DIR)/src/liblua.a bin
bin:
mkdir bin
$(INSTALL_DIR):
mkdir -p $(INSTALL_DIR)