Browse code

- support for apart modules taken from svn, fixed bug for dependency files *.d - new config param INCLUDES (all includes -I goes here, CFLAGS was not good for MAKDEP)

Tomas Mandys authored on 08/01/2006 12:54:41
Showing 3 changed files
... ...
@@ -482,6 +482,7 @@ endif
482 482
 
483 483
 CFLAGS=
484 484
 LDFLAGS=
485
+INCLUDES=
485 486
 # setting CFLAGS
486 487
 ifeq ($(mode), release)
487 488
 	#if i386
... ...
@@ -6,14 +6,18 @@
6 6
 #
7 7
 MOD_NAME=$(NAME:.so=)
8 8
 
9
-ALLDEP=Makefile ../../Makefile.sources ../../Makefile.rules \
10
- ../../Makefile.modules
9
+# allow place modules in separate directory apart from ser core
10
+COREPATH ?=../..
11
+
12
+ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
13
+ $(COREPATH)/Makefile.modules
11 14
 
12 15
 #override modules value, a module cannot have submodules
13 16
 override modules=
14 17
 override static_modules=
15 18
 override static_modules_path=
16 19
 
20
+INCLUDES += -I$(COREPATH)
17 21
 
18 22
 ifeq ($(MAKELEVEL), 0)
19 23
 # make called directly in the module dir!
... ...
@@ -26,15 +30,15 @@ endif
26 26
 else
27 27
 # called by the main Makefile
28 28
 
29
-ALLDEP+=../../Makefile ../../Makefile.defs
29
+ALLDEP+=$(COREPATH)/Makefile $(COREPATH)/Makefile.defs
30 30
 
31 31
 endif
32 32
 
33
-include ../../Makefile.sources
33
+include $(COREPATH)/Makefile.sources
34 34
 
35 35
 ifeq (,$(filter $(MOD_NAME), $(static_modules)))
36 36
 CFLAGS:=$(MOD_CFLAGS)
37 37
 LDFLAGS:=$(MOD_LDFLAGS)
38 38
 endif
39 39
 
40
-include ../../Makefile.rules
40
+include $(COREPATH)/Makefile.rules
... ...
@@ -6,7 +6,7 @@
6 6
 #
7 7
 
8 8
 #
9
-# Uses: NAME, ALLDEP, CC, CFLAGS, DEFS, LIBS, MKDEP, auto_gen, auto_gen_others,
9
+# Uses: NAME, ALLDEP, CC, CFLAGS, DEFS, INCLUDES, LIBS, MKDEP, auto_gen, auto_gen_others,
10 10
 # depends, objs, extra_objs, static_modules, static_modules_path
11 11
 # (all this must  be defined previously!,  see Makefile.defs & Makefile)
12 12
 #
... ...
@@ -15,10 +15,10 @@
15 15
 
16 16
 #implicit rules
17 17
 %.o:%.c  $(ALLDEP)
18
-	$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
18
+	$(CC) $(CFLAGS) $(INCLUDES) $(DEFS) -c $< -o $@
19 19
 
20 20
 %.d: %.c $(ALLDEP)
21
-	@set -e; $(MKDEP) $(DEFS) $< \
21
+	@set -e; $(MKDEP) $(INCLUDES) $(DEFS) $< \
22 22
 	|  sed 's#\(\($*D)\)\?$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
23 23
 	[ -s $@ ] || rm -f $@
24 24