blob: 0f2908ab9913f003a047bc1eeb9e3cf17c06bdae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# makefile description.
# add gems to the ruby library
LIBR := ../lib/libmruby.a
INIT := init_gems
RM_F := rm -f
CC_FLAGS := -Wall -Werror-implicit-function-declaration -g -O3 -MMD -I. -I./../include
MMAKER := ./gem_helper
MMAKER_BIN := $(MMAKER)
export CC = gcc
export LL = gcc
export AR = ar
##############################
# generic build targets, rules
.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) $<
$(MMAKER).o : $(MMAKER).c
$(CC) $(CC_FLAGS) -MMD -c $< -o $@
$(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
test :
@$(MAKE) test -C g
# clean driver and all gems
.PHONY : clean
clean : $(MMAKER_BIN)
@echo "Cleanup Gems"
$(MMAKER_BIN) makefile > g/Makefile
$(MAKE) clean -C g
-$(RM_F) $(INIT).c *.o *.d $(MMAKER_BIN) g/Makefile
|