summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-11-24 08:12:30 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2011-11-24 08:12:30 +0100
commit9121a863953f2ead710347a630fa25acae80ad11 (patch)
tree148b95313194380582c00e89d9b480c25419e2b1
parent42ac16b95859cbb7057fadfff0ff4bc92cb0b374 (diff)
downloadlibuniso-9121a863953f2ead710347a630fa25acae80ad11.tar.bz2
libuniso-9121a863953f2ead710347a630fa25acae80ad11.tar.xz
build: rearrange makefile a bit
-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