... | ... |
@@ -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 | 30 |
else |
27 | 31 |
# called by the main Makefile |
28 | 32 |
|
29 |
-ALLDEP+=../../Makefile ../../Makefile.defs |
|
33 |
+ALLDEP+=$(COREPATH)/Makefile $(COREPATH)/Makefile.defs |
|
30 | 34 |
|
31 | 35 |
endif |
32 | 36 |
|
33 |
-include ../../Makefile.sources |
|
37 |
+include $(COREPATH)/Makefile.sources |
|
34 | 38 |
|
35 | 39 |
ifeq (,$(filter $(MOD_NAME), $(static_modules))) |
36 | 40 |
CFLAGS:=$(MOD_CFLAGS) |
37 | 41 |
LDFLAGS:=$(MOD_LDFLAGS) |
38 | 42 |
endif |
39 | 43 |
|
40 |
-include ../../Makefile.rules |
|
44 |
+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 |
|