-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (30 loc) · 839 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
37
sources = $(wildcard src/*.c)
includes = $(wildcard include/*.h)
objects = $(sources:.c=.o)
flags = -g -c -w -fPIC -std=c99 -luuid -ljson-c
build: $(objects)
gcc $(objects) $(flags) -o ./bin/$(oyamo_exec)
%.o: %.c include/%.h
gcc -c $(flags) $< -o $@
clean:
-rm -rf ./bin/*
-rm -rf ./build/*
-rm -rf ./src/*.o
generate-so:
gcc $(objects) $(flags) -shared -o ./build/liboyamo.so -fPIC
liboyamo.a: $(objects)
ar rcs ./build/$@ $^
install-dependencies:
sudo apt-get install libjson-c-dev
sudo apt-get install libuuid1
install:
make install-dependencies
make clean && make
make liboyamo.a
make uninstall
sudo mkdir -p /usr/local/include/oyamo
sudo cp $(includes) /usr/local/include/oyamo/
sudo cp ./build/liboyamo.a /usr/local/lib/
uninstall:
sudo rm -f -r /usr/local/include/oyamo
sudo rm -f /usr/local/lib/liboyamo.a