summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/Makefile
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-09-19 09:34:24 +0900
committerDaniel Bovensiepen <[email protected]>2012-09-19 09:34:24 +0900
commit17c877011d2ecaba8a904f1b5b87a4aa2f5a82bb (patch)
treee0b212123013e0066f55c3242a334cc8c14ac891 /mrbgems/Makefile
parentea68cb1beb1c561a1d960857a830dd5b6f2e497e (diff)
downloadmruby-17c877011d2ecaba8a904f1b5b87a4aa2f5a82bb.tar.gz
mruby-17c877011d2ecaba8a904f1b5b87a4aa2f5a82bb.zip
Some additional changes to compile properly
Diffstat (limited to 'mrbgems/Makefile')
-rw-r--r--mrbgems/Makefile21
1 files changed, 12 insertions, 9 deletions
diff --git a/mrbgems/Makefile b/mrbgems/Makefile
index 970baadac..abd726a0e 100644
--- a/mrbgems/Makefile
+++ b/mrbgems/Makefile
@@ -1,7 +1,7 @@
# makefile description.
# add gems to the ruby library
-LIBRGEMS := ../lib/libmruby_gems.a
+LIBR := ../lib/libmruby.a
INIT := init_gems
RM_F := rm -f
CC_FLAGS := -Wall -Werror-implicit-function-declaration -g -O3 -MMD -I. -I./../include
@@ -9,6 +9,7 @@ MMAKER := ./gem_helper
MMAKER_BIN := $(MMAKER)
export CC = gcc
export LL = gcc
+export AR = ar
##############################
# generic build targets, rules
@@ -16,17 +17,10 @@ export LL = gcc
.PHONY : all
all : $(INIT).o all_gems
-$(INIT).o : $(INIT).c
- @echo "Build the driver which initiailizes all gems"
- gcc $(CC_FLAGS) -c $< -o $@
-
-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 $@
@@ -34,10 +28,19 @@ $(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 $@
+ $(AR) rs $(LIBR) $@
+
g/Makefile :
@echo "Generate Gem Makefile"
$(MMAKER_BIN) makefile > $@
+all_gems : $(MMAKER_BIN) g/Makefile
+ @echo "Build all gems"
+ $(MAKE) -C g
+
# clean driver and all gems
.PHONY : clean
clean : $(MMAKER_BIN)