-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
54 lines (36 loc) · 998 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
#
# Makefile for the Vehicle Signal Distribution system.
#
NAME=vsd
DESTDIR ?= /usr/local
INCLUDE=vehicle_signal_distribution.h
SHARED_OBJ=vsd.o
TARGET_SO=libvsd.so
CFLAGSLIST= -ggdb -Wall -I/usr/local -fPIC $(CFLAGS) $(CPPFLAGS)
.PHONY: all clean install nomacro uninstall examples install_examples
export CFLAGSLIST
all: $(TARGET_SO)
nomacro:
$(MAKE) -C examples nomacro
$(TARGET_SO): $(SHARED_OBJ)
$(CC) --shared $(CFLAGSLIST) $^ $(LDFLAGS) -o $@
# Recompile everything if dstc.h changes
$(SHARED_OBJ): $(INCLUDE)
.c.o:
$(CC) -c $(CFLAGSLIST) $<
clean:
rm -f *~ $(SHARED_OBJ) $(TARGET_SO)
$(MAKE) -C examples clean
install:
install -d ${DESTDIR}/lib
install -d ${DESTDIR}/include
install -d ${DESTDIR}/share
install -m 0644 ${TARGET_SO} ${DESTDIR}/lib
install -m 0644 ${INCLUDE} ${DESTDIR}/include
uninstall:
rm -f ${DESTDIR}/lib/${TARGET_SO}
(cd ${DESTDIR}/include; rm -f ${INCLUDE})
examples:
$(MAKE) -C examples
install_examples:
$(MAKE) -C examples install