Commit 17c87701 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

Some additional changes to compile properly

parent ea68cb1b
# 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)
......
......@@ -7,13 +7,14 @@ RM_F := rm -f
AR := ar
ifeq ($(strip $(LIBR)),)
# default compile option
# default mruby library
LIBR = $(MRUBY_ROOT)lib/libmruby.a
endif
.PHONY : all
all : src/md5.o src/mrb_md5.o
@echo "Gem '$(GEMNAME)' is done"
@$(AR) rs $(LIBR) src/md5.o src/mrb_md5.o
@echo "Gem '$(GEMNAME)' is done"
md5.o : src/md5.c
@gcc -c -I. src/md5.c
......@@ -21,5 +22,7 @@ md5.o : src/md5.c
mrb_md5.o : src/mrb_md5.c
@gcc -c $(CFLAGS) src/mrb_md5.c
.PHONY : clean
clean :
-$(RM_F) src/*.o
@echo "Gem '$(GEMNAME)' is clean"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment