From 17b3f5e02e38d57f62bfcd86f9398db9e14e6921 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 8 Apr 2017 11:12:25 +0200 Subject: [PATCH] Support generic target compilation --- docs/examples/web/makefile | 9 ++++----- examples/Makefile | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/examples/web/makefile b/docs/examples/web/makefile index 0d12cb09f..139b3e8a0 100644 --- a/docs/examples/web/makefile +++ b/docs/examples/web/makefile @@ -271,6 +271,10 @@ EXAMPLES = \ # in this case, the 'default' target entry is raylib all: examples +# generic compilation pattern +%: %.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS) + # compile all examples examples: $(EXAMPLES) @@ -535,8 +539,3 @@ ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js endif @echo Cleaning done - -# instead of defining every module one by one, we can define a pattern -# this pattern below will automatically compile every module defined on $(OBJS) -#%.exe : %.c -# $(CC) -o $@ $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) diff --git a/examples/Makefile b/examples/Makefile index ac5d22266..58e8cb50e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -278,6 +278,10 @@ EXAMPLES = \ # in this case, the 'default' target entry is raylib all: examples +# generic compilation pattern +%: %.c + $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS) + # compile all examples examples: $(EXAMPLES) @@ -565,8 +569,3 @@ ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js endif @echo Cleaning done - -# instead of defining every module one by one, we can define a pattern -# this pattern below will automatically compile every module defined on $(OBJS) -#%.exe : %.c -# $(CC) -o $@ $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM)