forked from tiwareep/louDBus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (93 loc) · 2.88 KB
/
Copy pathMakefile
File metadata and controls
128 lines (93 loc) · 2.88 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# adbc-psr/Makefile
# A Makefile for A D-Bus Client for PLT Scheme and Racket
# +-----------------------+-------------------------------------------
# | Configurable Settings |
# +-----------------------+
# These may need to be changed on various systems.
# The current version of the system
VERSION = 0.1
# +-------+-----------------------------------------------------------
# | Files |
# +-------+
# All of the sources we use. Important primarily for packaging.
RACKET_SOURCES = \
unsafe.rkt \
test.rkt \
compiled-goes-here.rkt
C_SOURCES = \
loudbus.c
SCRIPTS = \
racocflags \
racocppflags
OTHER_FILES = \
Makefile \
README \
MANIFEST \
INSTALL \
DETAILS \
TODO
FILES = \
$(C_SOURCES) \
$(RACKET_SOURCES) \
$(SCRIPTS) \
$(OTHER_FILES)
# +----------+--------------------------------------------------------
# | Settings |
# +----------+
CFLAGS = -g -Wall -fPIC \
$(shell pkg-config --cflags gio-2.0 glib-2.0 gio-unix-2.0) \
-I/usr/include/racket
RACO_CFLAGS = $(shell echo '' $(CFLAGS) | ./racocflags)
LDLIBS = $(shell pkg-config --libs gio-2.0 glib-2.0 gio-unix-2.0)
RACO_LDLIBS = ++ldl -lgio-2.0 ++ldl -lgobject-2.0 ++ldl -lglib-2.0
# Inside Racket says to use --cgc, but that requires mzdyn.o, which does
# not seem to ship with the standard distribution, and I'm lazy.
RACO_GC = --3m
# We need to know where to put the compiled Racket library.
COMPILED_DIR = $(shell racket compiled-goes-here.rkt)
# +------------------+------------------------------------------------
# | Standard Targets |
# +------------------+
default: build
build: $(COMPILED_DIR)/loudbus.so
clean:
rm -f *.o
rm -f *.so
rm -rf compiled
rm -rf louDBus-$(VERSION)
rm -rf *.tar.gz
rm -rf *~
package: louDBus-$(VERSION).tar.gz
install-local: build
raco link `pwd`
# +---------+---------------------------------------------------------
# | Details |
# +---------+
# Making tar files.
louDBus-$(VERSION).tar.gz: $(FILES)
rm -rf louDBus.$(VERSION)
mkdir louDBus.$(VERSION)
cp $(FILES) louDBus-$(VERSION)
tar cvfa $@ louDBus-$(VERSION)
# Making the louDBus library (using the Inside Racket API)
loudbus.o: loudbus.c
raco ctool --cc $(RACO_GC) $(RACO_CFLAGS) $^
loudbus.so: loudbus.o
raco ctool --vv $(RACO_GC) ++ldf -L/usr/lib/x86_64-linux-gnu $(RACO_LDLIBS) --ld $@ $^
# The louDBus library needs to go into the directory for compiled modules.
$(COMPILED_DIR)/loudbus.so: loudbus.so
install -D $^ $@
# +---------------------+---------------------------------------------
# | Header Dependencies |
# +---------------------+
libadbc.o: adbc.h
adbc-psr.o:
# +-------------+-----------------------------------------------------
# | Experiments |
# +-------------+
.PHONY: preprocess
preprocess:
$(CC) $(CFLAGS) -E adbc-psr.c | less
.PHONY: rflags
rflags:
echo 'RACO_FLAGS' $(RACO_CFLAGS)