Skip to content

Commit 94e5b2e

Browse files
committed
test
1 parent 63d8aab commit 94e5b2e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ export VERSION_FLAGS=-DGIT_HASH="\"$(shell git rev-parse HEAD 2> /dev/null || ec
3737
-DBUILD_USER="\"$(USER)@$(HOSTNAME)\""\
3838
-DBUILD_DIRECTORY="\"$(PWD)\""
3939

40+
41+
42+
OS := $(shell uname)
43+
ifeq ($(OS),Darwin)
44+
SONAME := install_name,@rpath/
45+
else
46+
SONAME := soname
47+
endif
48+
49+
4050
X11DIR= $(shell pkg-config --libs-only-L x11 xpm) # for macOS
4151
CFLAGS= -c -std=gnu11 $(OPT) $(GPROF) $(W) $(GDB)
4252
OFLAGS= -lm $(GPROF) $(LIBS) -lX11 -lXpm $(X11DIR)
@@ -66,7 +76,8 @@ v : $(allobj)
6676
$(CC) $^ -o $@ $(OFLAGS)
6777

6878
v.so: $(allpic)
69-
$(CC) $^ -shared -Wl,-soname,$@ $(OFLAGS) -o $@
79+
$(CC) $^ -shared -Wl,-$(SONAME),$@ $(OFLAGS) -o $@
80+
7081

7182
$(OBJDIR)/%.o : $(SRCDIR)/%.c
7283
$(CC) $(CFLAGS) $< -o $@ $(INCL) $(VERSION_FLAGS) -MMD -MT "$@ $(patsubst $(OBJDIR)%,$(PICDIR)%,$@)"

0 commit comments

Comments
 (0)