From e6716313137bc397d7d7d42faf07b06a5fea65c1 Mon Sep 17 00:00:00 2001
From: johannst <johannes.stoelp@gmail.com>
Date: Wed, 21 Apr 2021 23:44:16 +0200
Subject: own make target for libgreet.so

---
 04_dynld_nostd/Makefile | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

(limited to '04_dynld_nostd/Makefile')

diff --git a/04_dynld_nostd/Makefile b/04_dynld_nostd/Makefile
index c1a472a..e72dde8 100644
--- a/04_dynld_nostd/Makefile
+++ b/04_dynld_nostd/Makefile
@@ -7,15 +7,7 @@ COMMON_CFLAGS := -g -O0 -Wall -Wextra \
 run: main
 	./$<
 
-main: dynld.so main.c ../lib/libcommon.a
-	@# For now ew only add support for ELF hash tables (DT_HASH).
-	@# Therefore we specify the `hash-style` below.
-	gcc -o libgreet.so        \
-	    $(COMMON_CFLAGS)      \
-	    -fPIC -shared         \
-	    -Wl,--hash-style=sysv \
-	    libgreet.c
-
+main: dynld.so libgreet.so main.c ../lib/libcommon.a
 	@# For now ew only add support for ELF hash tables (DT_HASH).
 	@# Therefore we specify the `hash-style` below.
 	gcc -o $@                                   \
@@ -31,6 +23,15 @@ main: dynld.so main.c ../lib/libcommon.a
 	objdump --disassemble -j .plt -M intel $@
 	objdump --disassemble=_start -M intel $@
 
+libgreet.so: libgreet.c
+	@# For now ew only add support for ELF hash tables (DT_HASH).
+	@# Therefore we specify the `hash-style` below.
+	gcc -o $@                 \
+	    $(COMMON_CFLAGS)      \
+	    -fPIC -shared         \
+	    -Wl,--hash-style=sysv \
+	    $^
+
 dynld.so: dynld.S dynld.c ../lib/libcommon.a
 	gcc -o $@                          \
 	    $(COMMON_CFLAGS)               \
-- 
cgit v1.2.3