Skip to content

Commit 7242f55

Browse files
committed
refactor: cleaned up the Makefile.
1 parent 485b229 commit 7242f55

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ OBJ := $(SRC:.c=.o)
1212

1313
C_SO_NAME := librestychash.so
1414

15-
CFLAGS := -Wall -O3 -g
16-
THE_CFLAGS := $(CFLAGS) -fPIC -MMD -fvisibility=hidden
15+
CFLAGS := -O3 -g -Wall -fpic
16+
17+
LDFLAGS := -shared
18+
# on Mac OS X, one should set instead:
19+
# LDFLAGS := -bundle -undefined dynamic_lookup
20+
21+
MY_CFLAGS := $(CFLAGS) -DBUILDING_SO
22+
MY_LDFLAGS := $(LDFLAGS) -fvisibility=hidden
1723

1824
test := t
1925

@@ -22,10 +28,10 @@ test := t
2228
all : $(C_SO_NAME)
2329

2430
${OBJ} : %.o : %.c
25-
$(CC) $(THE_CFLAGS) -DBUILDING_SO -c $<
31+
$(CC) $(MY_CFLAGS) -c $<
2632

2733
${C_SO_NAME} : ${OBJ}
28-
$(CC) $(THE_CFLAGS) -DBUILDING_SO $^ -shared -o $@
34+
$(CC) $(MY_LDFLAGS) $^ -o $@
2935

3036
#export TEST_NGINX_NO_CLEAN=1
3137

0 commit comments

Comments
 (0)