From d6f2f55b46ceddd986e7ba42fb8269aef0ca8e77 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Fri, 21 Sep 2012 19:56:28 +0800 Subject: Add Support for Ruby Extensions, C Extensions and Test Integration --- mrbgems/Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'mrbgems/Makefile') diff --git a/mrbgems/Makefile b/mrbgems/Makefile index 0f2908ab9..1cb5b8a83 100644 --- a/mrbgems/Makefile +++ b/mrbgems/Makefile @@ -17,29 +17,31 @@ export AR = ar .PHONY : all all : $(INIT).o all_gems -$(MMAKER_BIN) : $(MMAKER).o - @echo "Build the generator which creates the driver and Gem Makefile" - $(LL) -o $@ $(CC_FLAGS) $< +all_gems : g/Makefile + @echo "Build all gems" + $(MAKE) -C g -$(MMAKER).o : $(MMAKER).c - $(CC) $(CC_FLAGS) -MMD -c $< -o $@ +g/Makefile : $(MMAKER_BIN) + @echo "Generate Gem Makefile" + $(MMAKER_BIN) makefile > $@ $(INIT).c : $(MMAKER_BIN) @echo "Generate Gem driver" $(MMAKER_BIN) $(INIT) > $@ $(INIT).o : $(INIT).c - @echo "Build the driver which initiailizes all gems" - gcc $(CC_FLAGS) -c $< -o $@ + @echo "Build the driver which initializes all gems" + $(CC) $(CC_FLAGS) -MMD -c $< -o $@ $(AR) rs $(LIBR) $@ -g/Makefile : - @echo "Generate Gem Makefile" - $(MMAKER_BIN) makefile > $@ +# Generator -all_gems : $(MMAKER_BIN) g/Makefile - @echo "Build all gems" - $(MAKE) -C g +$(MMAKER_BIN) : $(MMAKER).o + @echo "Build the generator which creates the driver and Gem Makefile" + $(LL) -o $@ $(CC_FLAGS) $< + +$(MMAKER).o : $(MMAKER).c + $(CC) $(CC_FLAGS) -MMD -c $< -o $@ test : @$(MAKE) test -C g -- cgit v1.2.3