From f142bb942d54b1387dc887220072a3f798a285a6 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 30 Dec 2019 09:13:56 +1100 Subject: Use pattern rules instead of suffix rules as they are clearer. Add a .PHONY target to avoid possible failure caused by file with same name. --- gtk/makefile | 10 ++++++---- win32/makefile | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gtk/makefile b/gtk/makefile index 54c9c0472..cde17ea80 100644 --- a/gtk/makefile +++ b/gtk/makefile @@ -7,6 +7,8 @@ # Builds for GTK+ 2 and 3. GTK 3 requires GTK3=1 on command line. # Also works with ming32-make on Windows. +.PHONY: all clean analyze depend + .SUFFIXES: .cxx .c .o .h .a .list srcdir ?= . @@ -84,17 +86,17 @@ all: $(COMPLIB) clean: $(DEL) *.o $(call normalize,$(COMPLIB)) *.plist -.cxx.o: +%.o: %.cxx $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $< -.c.o: +%.o: %.c $(CC) $(DEFINES) $(INCLUDES) $(CONFIG_FLAGS) $(BASE_FLAGS) $(CFLAGS) -w -c $< GLIB_GENMARSHAL = glib-genmarshal GLIB_GENMARSHAL_FLAGS = --prefix=scintilla_marshal -.list.h: +%.h: %.list $(GLIB_GENMARSHAL) --header $(GLIB_GENMARSHAL_FLAGS) $< > $@ -.list.c: +%.c: %.list $(GLIB_GENMARSHAL) --body $(GLIB_GENMARSHAL_FLAGS) $< > $@ analyze: diff --git a/win32/makefile b/win32/makefile index 2c7700e7f..3dad7d045 100644 --- a/win32/makefile +++ b/win32/makefile @@ -5,6 +5,8 @@ # This makefile assumes Mingw-w64 GCC 9.0+ is used and changes will be needed to use other compilers. # Clang 9.0+ can be used with CLANG=1 on command line. +.PHONY: all clean analyze depend + .SUFFIXES: .cxx .c .o .h .a DIR_BIN=../bin @@ -64,7 +66,7 @@ all: $(COMPONENT) $(LEXCOMPONENT) $(LIBSCI) clean: $(DEL) *.exe *.o *.a *.obj *.dll *.res *.map *.plist -.cxx.o: +%.o: %.cxx $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $< analyze: -- cgit v1.2.3