aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-02-10 16:37:36 +0100
committerMattias Andrée <m@maandree.se>2025-02-10 16:37:36 +0100
commit620104e2e178dc3bcfe54efc0b43d668f79f786f (patch)
tree1e4e1444af5ebdc4f7fef49c3fed0735115f053d /Makefile
parentPRIORITY-REGISTRY: fix signess and position of radharc entry, and expand tabs (diff)
downloadlibcoopgamma-620104e2e178dc3bcfe54efc0b43d668f79f786f.tar.gz
libcoopgamma-620104e2e178dc3bcfe54efc0b43d668f79f786f.tar.bz2
libcoopgamma-620104e2e178dc3bcfe54efc0b43d668f79f786f.tar.xz
Improve makefile
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--Makefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7adb022..23e9eca 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,18 @@ LIB_MINOR = 2
LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
+OBJ = libcoopgamma.o
+HDR = libcoopgamma.h
+
+LOBJ = $(OBJ:.o=.lo)
+
+
include man.mk
all: libcoopgamma.a libcoopgamma.$(LIBEXT) test
+$(OBJ): $(HDR)
+$(LOBJ): $(HDR)
.c.o:
$(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
@@ -26,12 +34,13 @@ all: libcoopgamma.a libcoopgamma.$(LIBEXT) test
.c.lo:
$(CC) -fPIC -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
-libcoopgamma.a: libcoopgamma.o
- $(AR) rc $@ $?
+libcoopgamma.a: $(OBJ)
+ @rm -f -- $@
+ $(AR) rc $@ $(OBJ)
$(AR) s $@
-libcoopgamma.$(LIBEXT): libcoopgamma.lo
- $(CC) $(LIBFLAGS) -o $@ libcoopgamma.lo $(LDFLAGS)
+libcoopgamma.$(LIBEXT): $(LOBJ)
+ $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS)
test: test.o libcoopgamma.a
$(CC) -o $@ test.o libcoopgamma.a $(LDFLAGS)