[hackers] [surf/surf-webkit2] Makefile: include common to webext || Quentin Rameau

From: <git_AT_suckless.org>
Date: Wed, 6 Feb 2019 11:02:06 +0100 (CET)

commit 890b2fc3960b76086a9c2b645d0592135f7d5284
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Feb 6 10:27:01 2019 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Wed Feb 6 10:53:05 2019 +0100

    Makefile: include common to webext

diff --git a/Makefile b/Makefile
index 90df791..0e322d6 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -4,9 +4,11 @@
 
 include config.mk
 
-SRC = surf.c common.c
-OBJ = $(SRC:.c=.o)
+SRC = surf.c
+CSRC = common.c
 WEBEXTSRC = libsurf-webext.c
+OBJ = $(SRC:.c=.o)
+COBJ = $(CSRC:.c=.o)
 WEBEXTOBJ = $(WEBEXTSRC:.c=.o)
 
 all: options libsurf-webext.so surf
_AT_@ -25,18 +27,21 @@ config.h:
         cp config.def.h $_AT_
 
 $(OBJ): config.h common.h config.mk
+$(COBJ): config.h common.h config.mk
+$(WEBEXTOBJ): config.h common.h config.mk
 
-$(WEBEXTOBJ): $(WEBEXTSRC) config.h common.h config.mk
+$(WEBEXTOBJ): $(WEBEXTSRC)
         $(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WEBEXTSRC)
 
-libsurf-webext.so: $(WEBEXTOBJ)
- $(CC) -shared -Wl,-soname,$_AT_ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS) -lc
+libsurf-webext.so: $(WEBEXTOBJ) $(COBJ)
+ $(CC) -shared -Wl,-soname,$_AT_ $(LDFLAGS) -o $@ \
+ $(WEBEXTOBJ) $(COBJ) $(WEBEXTLIBS)
 
-surf: $(OBJ)
- $(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $_AT_ $(OBJ) $(LIBS)
+surf: $(OBJ) $(COBJ)
+ $(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $_AT_ $(OBJ) $(COBJ) $(LIBS)
 
 clean:
- rm -f surf $(OBJ)
+ rm -f surf $(OBJ) $(OBJ)
         rm -f libsurf-webext.so $(WEBEXTOBJ)
 
 distclean: clean
diff --git a/config.mk b/config.mk
index fa22f30..5e68e38 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -24,7 +24,7 @@ LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0
 # flags
 CPPFLAGS = -DVERSION=\"$(VERSION)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
            -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE
-SURFCFLAGS = $(INCS) $(CPPFLAGS)
+SURFCFLAGS = $(INCS) $(CPPFLAGS) -fPIC
 WEBEXTCFLAGS = -fPIC $(WEBEXTINC)
 
 # compiler
Received on Wed Feb 06 2019 - 11:02:06 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 06 2019 - 11:12:22 CET