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