summaryrefslogtreecommitdiff
blob: e1c50a07eb89242f46cee0c930592849f0b5fe7d (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
--- xharbour-1.0.0-beta1/config/bin.cf.orig	2001-12-21 13:47:57.000000000 +0300
+++ xharbour-1.0.0-beta1/config/bin.cf	2009-03-04 18:42:51.000000000 +0300
@@ -35,8 +35,8 @@
 
 first:: dirbase descend
 
-descend :
-	@$(MK) -C $(ARCH_DIR) -f $(GRANDP)Makefile 'TOP=$(GRANDP)' $(EXE_NAME)
+descend:: dirbase
+	+@$(MK) -C $(ARCH_DIR) -f $(GRANDP)Makefile 'TOP=$(GRANDP)' $(EXE_NAME)
 
 $(EXE_NAME) : $(ALL_OBJS)
 	$(LD_RULE)
--- xharbour-1.0.0-beta1/config/lib.cf.orig	2003-08-25 20:24:52.000000000 +0400
+++ xharbour-1.0.0-beta1/config/lib.cf	2009-03-04 18:44:30.000000000 +0300
@@ -44,11 +44,11 @@
 endif
 endif
 
-descend :
-	@$(MK) -C $(ARCH_DIR) -f $(GRANDP)Makefile 'TOP=$(GRANDP)' 'HB_LIBCOMP_MT=NO' $(LIB_NAME)
+descend:: dirbase
+	+@$(MK) -C $(ARCH_DIR) -f $(GRANDP)Makefile 'TOP=$(GRANDP)' 'HB_LIBCOMP_MT=NO' $(LIB_NAME)
 
-descend_mt:
-	@$(MK) -C $(ARCH_DIR)_mt -f $(GRANDP)Makefile 'TOP=$(GRANDP)' 'HB_LIBCOMP_MT=YES' $(MT_LIB_NAME)
+descend_mt:: dirbase_mt
+	+@$(MK) -C $(ARCH_DIR)_mt -f $(GRANDP)Makefile 'TOP=$(GRANDP)' 'HB_LIBCOMP_MT=YES' $(MT_LIB_NAME)
 
 $(LIB_NAME) : $(ALL_OBJS)
 	$(AR_RULE)
--- xharbour-1.0.0-beta1/config/dir.cf.orig	2009-03-04 18:58:03.000000000 +0300
+++ xharbour-1.0.0-beta1/config/dir.cf	2009-03-04 19:01:17.000000000 +0300
@@ -6,16 +6,73 @@
 ifneq ($(HB_COMPILER),)
 
 include $(TOP)$(ROOT)config/global.cf
+# this make version does not work correctly parallel execution rules below
+ifeq ($(MAKE_VERSION),3.79.1)
 include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/dir.cf
+endif
+
+ifeq ($(DIR_RULE),)
+
+# NOTE: The empty line directly before 'endef' HAVE TO exist!
+# It causes that every commands will be separated by LF
+define dir_mk
+$(MK) -C $(dir) $@
+
+endef
+
+DIRS_PURE = $(filter-out {%},$(subst {, {,$(DIRS)))
+DIRS_DEP  = $(filter-out $(DIRS_PURE),$(DIRS))
+DIRS_MK   = $(foreach d, $(DIRS_PURE), $(if $(wildcard $(d)/Makefile),$(d),))
+DIR_RULE = $(foreach dir, $(DIRS_MK), $(dir_mk))
+MULTI_DEPS = yes
+
+else
+
+DIRS := $(filter-out {%},$(subst {, {,$(DIRS)))
+MULTI_DEPS = no
+
+endif
 
 all : first
 
+ifneq ($(MULTI_DEPS),yes)
+
 first clean install::
-	$(DIR_RULE)
+	+$(DIR_RULE)
+
+else
+
+DIRS_CLEAN = $(foreach dir, $(DIRS_MK), $(dir).clean)
+DIRS_INST  = $(foreach dir, $(DIRS_MK), $(dir).inst)
+
+first   :: $(DIRS_MK)
+install :: $(DIRS_INST)
+clean   :: $(DIRS_CLEAN)
+
+comma=,
+define dep_rule
+$(subst $(comma),$(2) ,$(subst },$(2),$(subst {,$(2)::|,$(1))))
+endef
+
+$(foreach dep, $(DIRS_DEP), $(eval $(call dep_rule,$(dep),.clean)))
+$(foreach dep, $(DIRS_DEP), $(eval $(call dep_rule,$(dep),.inst)))
+$(foreach dep, $(DIRS_DEP), $(eval $(call dep_rule,$(dep),)))
+
+$(DIRS_CLEAN) ::
+	+$(MK) -C $(@:.clean=) clean
+
+$(DIRS_INST) ::
+	+$(MK) -C $(@:.inst=) install
+
+$(DIRS_MK) ::
+	+$(MK) -C $(@)
+
+endif
+
 
 ifneq ($(HB_POSTINST),)
 install::
-	$(HB_POSTINST)
+	+$(HB_POSTINST)
 endif
 
 endif
--- xharbour-1.0.0-beta1/source/Makefile.orig	2009-03-04 19:23:38.000000000 +0300
+++ xharbour-1.0.0-beta1/source/Makefile	2009-03-04 19:27:42.000000000 +0300
@@ -23,26 +23,28 @@
 
 else
 
+HB_COMP_REF={compiler}
+
 DIRS=\
 	common \
-	pp \
-	compiler \
-	rtl \
-	vm \
+	pp{common} \
+	compiler{pp} \
+	rtl$(HB_COMP_REF) \
+	vm$(HB_COMP_REF) \
 	macro \
 	codepage \
 	lang \
-	rdd \
-	debug \
-	odbc \
-	ct \
+	rdd$(HB_COMP_REF) \
+	debug$(HB_COMP_REF) \
+	odbc$(HB_COMP_REF) \
+	ct$(HB_COMP_REF) \
 	misc \
-	cgi
+	cgi$(HB_COMP_REF)
 
 ifneq ($(HB_ARCHITECTURE),dos)
 
 DIRS+=\
-	tip 
+	tip$(HB_COMP_REF) 
 
 endif
 
--- xharbour-1.0.0-beta1/Makefile.orig	2004-09-15 00:15:12.000000000 +0400
+++ xharbour-1.0.0-beta1/Makefile	2009-03-04 19:33:50.000000000 +0300
@@ -7,7 +7,7 @@
 DIRS=\
 	include \
 	source \
-	utils \
+	utils{source} \
 #	tests \
 #	samples \