about summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2020-11-07 18:43:11 +0100
committerQuentin Rameau <quinq@fifth.space>2020-11-07 18:43:11 +0100
commit7dcce9e1b9dbd2be198c19abd36e71eba7d09063 (patch)
treede3031649c8bf627740557fadb58bb9baf59cb64
parentwebext: Fix missing flags for gio (diff)
downloadsurf-7dcce9e1b9dbd2be198c19abd36e71eba7d09063.tar.gz
surf-7dcce9e1b9dbd2be198c19abd36e71eba7d09063.tar.bz2
surf-7dcce9e1b9dbd2be198c19abd36e71eba7d09063.zip
Makefile: use explicit targets
Some make implementation have trouble with following inference rules
indirection
-rw-r--r--Makefile19
1 files changed, 9 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 9f93b0b..e5d4172 100644
--- a/Makefile
+++ b/Makefile
@@ -19,22 +19,22 @@ options:
 	@echo "WEBEXTCFLAGS  = $(WEBEXTCFLAGS) $(CFLAGS)"
 	@echo "LDFLAGS       = $(LDFLAGS)"
 
-.c.o:
-	$(CC) $(SURFCFLAGS) $(CFLAGS) -c $<
+surf: $(OBJ)
+	$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
 
-.o.so:
-	$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS)
+$(OBJ) $(WOBJ): config.h common.h config.mk
 
 config.h:
 	cp config.def.h $@
 
-$(OBJ) $(WOBJ): config.h common.h config.mk
+$(OBJ): $(SRC)
+	$(CC) $(SURFCFLAGS) $(CFLAGS) -c $(SRC)
 
-surf: $(OBJ)
-	$(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+$(WLIB): $(WOBJ)
+	$(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $? $(WEBEXTLIBS)
 
-$(WOBJ):
-	$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(@:.o=.c)
+$(WOBJ): $(WSRC)
+	$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WSRC)
 
 clean:
 	rm -f surf $(OBJ)
@@ -73,5 +73,4 @@ uninstall:
 	done
 	- rmdir $(DESTDIR)$(LIBDIR)
 
-.SUFFIXES: .so .o .c
 .PHONY: all options distclean clean dist install uninstall