mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-25 00:29:18 -05:00
Support generic target compilation
This commit is contained in:
@ -271,6 +271,10 @@ EXAMPLES = \
|
|||||||
# in this case, the 'default' target entry is raylib
|
# in this case, the 'default' target entry is raylib
|
||||||
all: examples
|
all: examples
|
||||||
|
|
||||||
|
# generic compilation pattern
|
||||||
|
%: %.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
||||||
|
|
||||||
# compile all examples
|
# compile all examples
|
||||||
examples: $(EXAMPLES)
|
examples: $(EXAMPLES)
|
||||||
|
|
||||||
@ -535,8 +539,3 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
del *.o *.html *.js
|
del *.o *.html *.js
|
||||||
endif
|
endif
|
||||||
@echo Cleaning done
|
@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)
|
|
||||||
|
|||||||
@ -278,6 +278,10 @@ EXAMPLES = \
|
|||||||
# in this case, the 'default' target entry is raylib
|
# in this case, the 'default' target entry is raylib
|
||||||
all: examples
|
all: examples
|
||||||
|
|
||||||
|
# generic compilation pattern
|
||||||
|
%: %.c
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
||||||
|
|
||||||
# compile all examples
|
# compile all examples
|
||||||
examples: $(EXAMPLES)
|
examples: $(EXAMPLES)
|
||||||
|
|
||||||
@ -565,8 +569,3 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||||||
del *.o *.html *.js
|
del *.o *.html *.js
|
||||||
endif
|
endif
|
||||||
@echo Cleaning done
|
@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)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user