summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 22b3eb7..02ea3b4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,6 @@
ABI_VERSION := 0
SONAME := libuniso.so.$(ABI_VERSION)
-OBJS := libuniso.o
TARGETS := $(SONAME) libuniso.so uniso
@@ -9,15 +8,16 @@ CFLAGS ?= -g -Wall
CFLAGS += -fPIC
CFLAGS += -I.
+$(SONAME)_OBJS = libuniso.o
+$(SONAME)_LDFLAGS = -shared -Wl,-soname,$(SONAME)
+
uniso_OBJS := uniso.o
uniso_LIBS := -luniso
uniso_LDFLAGS += -L.
all: $(TARGETS)
-$(SONAME): $(OBJS)
- $(CC) -shared -Wl,-soname,$(SONAME) $(LDFLAGS) $($@_LDFLAGS) -o $@ $^
-
+$(SONAME): $($(SONAME)_OBJS)
libuniso.so: $(SONAME)
ln -s $< $@
@@ -25,7 +25,9 @@ libuniso.so: $(SONAME)
$(CC) $(CFLAGS) $($@_CFLAGS) -c $^
uniso: $(uniso_OBJS) libuniso.so
- $(CC) $(LDFLAGS) -o $@ $($@_OBJS) $($@_LIBS)
+
+uniso $(SONAME):
+ $(CC) $(LDFLAGS) $($@_LDFLAGS) -o $@ $($@_OBJS) $($@_LIBS)
clean:
rm -f $(TARGETS) *.o