-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 672 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 672 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
CC = gcc
CCFLAGS = -Wall -Wextra -fPIC -O3 -std=gnu99
LINKERFLAGS = -shared
LUAINC = /usr/include/lua5.2
installDir = /usr/local/lib
libName = libLua-GPIO.so
bin = bin
obj = $(bin)/obj
objs = $(obj)/lua-gpio.o $(obj)/gpio.o
.PHONY: clean
.PHONY: dir
.PHONY: install
.PHONY: uninstall
$(libName): dir
$(CC) $(CCFLAGS) -I$(LUAINC) -c src/lua-gpio.c -o $(obj)/lua-gpio.o
$(CC) $(CCFLAGS) -I$(LUAINC) -c src/gpio.c -o $(obj)/gpio.o
$(CC) $(LINKERFLAGS) $(objs) -o $(bin)/$@
clean:
rm $(obj)/lua-gpio.o
rm $(obj)/gpio.o
rm $(bin)/$(libName)
dir:
mkdir -p $(obj)
install:
cp $(bin)/$(libName) $(installDir)/$(libName)
uninstall:
rm -f $(installDir)/$(libName)