-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (29 loc) · 1.01 KB
/
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
# SPDX-License-Identifier: Unlicense
# chez-rpi Makefile.
# Install destination directory. This should be an object directory contained in (library-directories).
# eg, set in CHEZSCHEMELIBDIRS environment variable.
DEST = ~/lib
# Path to chez scheme executable.
SCHEME = /usr/bin/scheme
# Scheme compile flags.
SFLAGS = -q
# Path to install executable.
INSTALL = /usr/bin/install
CFLAGS = -c -fpic $(CONFIG_H)
LIBFLAGS = -shared
## Should be no need to edit anything below here.
COBJS = rpi/dht.o
BINS = rpi/libdht.so
# Libs need to go first or else there can be 'different compilation instance' exceptions.
SOBJS = rpi/ftypes-util.so rpi/dht-common.so rpi/poll.so rpi/cdht.so rpi/dht.so rpi/gpio.so rpi/gpiomem.so
all: $(BINS) $(SOBJS)
rpi/libdht.so: $(COBJS)
$(CC) $(LIBFLAGS) $^ -o $@
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
%.so: %.sls
echo '(reset-handler abort) (compile-library "'$<'")' | $(SCHEME) $(SFLAGS)
install: all
$(INSTALL) -D -p -t $(DEST)/rpi $(BINS) $(SOBJS)
clean:
rm -f $(COBJS) $(SOBJS) $(BINS)