blob: 363df6cfb51e349b8ace974bc22c49eec51b9e8c (
plain)
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
|
Adjust config.mk variables, fix cross-compilation, and don't run ldconfig.
--- a/Makefile
+++ b/Makefile
@@ -68,3 +68,6 @@
$(GEN):
- $(CC) -o $@ $(LDFLAGS) $@.o gen/util.o
+ $(BUILD_CC) -o $@ $(BUILD_LDFLAGS) $@.o gen/util.o
+
+gen/%.o:
+ $(BUILD_CC) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $<
@@ -84,3 +87,3 @@
libgrapheme.so: $(SRC:=.o)
- $(CC) -o $@ -shared $?
+ $(CC) -o $@ -shared $(LDFLAGS) $?
@@ -99,3 +102,2 @@
cp -f grapheme.h "$(DESTDIR)$(INCPREFIX)"
- ldconfig || true
--- a/config.mk
+++ b/config.mk
@@ -13,8 +13,4 @@
CPPFLAGS = -D_DEFAULT_SOURCE
-CFLAGS = -std=c99 -Os -fPIC -Wall -Wextra -Wpedantic
-LDFLAGS = -s
+CFLAGS := -std=c99 -fPIC -Wall -Wextra -Wpedantic $(CFLAGS)
# tools
-CC = cc
-AR = ar
-RANLIB = ranlib
|