-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 943 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
DESTDIR?=/usr
##ifneq ($V,1)
##Q ?= @
##endif
CC = gcc
CFLAGS = $(DEBUG) -fPIC -Wall -Wextra $(INCLUDE) -Winline -pipe
LDFLAGS = -L$(DESTDIR)/lib
LIBS = -lpthread -lrt -lm -lcrypt
SRC = src/main/C/comm.c
OBJ = $(SRC:.c=.o)
define buildjava
mvn clean package
endef
all: 16relind
16relind: compileshared createlibrary compilejava
.PHONY:compileshared
compileshared:
$Q echo [Compile]
$Q $(CC) -c -fPIC $(CFLAGS) $(SRC) -o build/C/comm.o
.PHONY:createlibrary
createlibrary: $(OBJ)
$Q echo "[Create Library]"
$Q $(CC) -shared build/C/comm.o -o build/C/libcomm.so
.PHONY:makejava
makejava:
$(call buildjava)
.PHONY: clean
clean:
$Q echo "[Clean]"
$Q rm -f $(OBJ) 16relind *~ core tags *.bak
.PHONY: install
install: createlibrary
$Q echo "[Install]"
$Q cp build/C/libcomm.so $(DESTDIR)/lib
$Q chmod 755 $(DESTDIR)/lib/libcomm.so
.PHONY: uninstall
uninstall:
$Q echo "[UnInstall]"
$Q rm -f $(DESTDIR)/lib/libcomm.so