forked from ShabbyX/RTAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile.am
166 lines (143 loc) · 4.73 KB
/
GNUmakefile.am
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
162
163
164
165
166
OPTDIRS =
if CONFIG_RTAI_TESTSUITE
OPTDIRS += testsuite
endif
if CONFIG_RTAI_ADDONS
OPTDIRS += addons
endif
if CONFIG_RTAI_LAB
OPTDIRS += rtai-lab
endif
OPTDIRS += rtai-py
SUBDIRS = base $(OPTDIRS)
DIST_SUBDIRS = \
base \
testsuite \
addons \
rtai-lab \
rtai-py
EXTRA_DIST = \
README.INSTALL \
README.ISOLCPUS \
README.LINUX_SERVER \
README.LXRT_EXTS_IN_USE \
README.SMI
DISTCLEANFILES = .rtai_config .rtai_config.old .cfok .cfchanged Module.symvers configure
moduledir = @RTAI_MODULE_DIR@
if CONFIG_RTAI_QUIET
MAKEFLAGS := $(MAKEFLAGS) --no-print-directory
endif
all-recursive install-recursive: base/GNUmakefile clean-if-reconfigured
base/GNUmakefile: @RTAI_LINUX_DIR@/.config
@echo "*****************************************" ; \
echo "* The Linux configuration has changed *" ; \
echo "* forcing 'make reconfig' ... *" ; \
echo "*****************************************" ; \
$(MAKE) reconfig
clean-if-reconfigured:
@if test -r .cfchanged ; then \
rm -f .cfchanged ; \
echo "****************************************" ; \
echo "* Your RTAI configuration has changed *" ; \
echo "* forcing 'make clean' ... *" ; \
echo "****************************************" ; \
$(MAKE) clean ; \
fi
CONFIG_METHODS := config nconfig menuconfig xconfig gconfig oldconfig silentoldconfig defconfig \
savedefconfig allnoconfig allyesconfig allmodconfig alldefconfig \
randconfig listnewconfig olddefconfig
.PHONY: $(CONFIG_METHODS)
$(CONFIG_METHODS):
@$(MAKE) -C base/config/kconfig \
-f Makefile.kconfig $@ \
srctree=$(PWD) ARCH=`uname -m` CONFIG_RTAI_QUIET=$(CONFIG_RTAI_QUIET)
@$(MAKE) --no-print-directory config-status
config-status: .rtai_config
@test -r config.status && recf=yes || recf=no ; \
eval `grep ^CONFIG_RTAI_INSTALLDIR $<`; \
eval `grep ^CONFIG_RTAI_MAINTAINER $<`; \
test x$$CONFIG_RTAI_MAINTAINER_AUTOTOOLS = xy && confopts=--enable-maintainer-mode; \
CROSS_COMPILE=$(CROSS_COMPILE) \
CC="$(CROSS_COMPILE)$(CC)" \
CXX="$(CROSS_COMPILE)$(CXX)" \
LD="$(CROSS_COMPILE)$(LD)" \
AR="$(CROSS_COMPILE)$(AR)" \
RANLIB=$(CROSS_COMPILE)ranlib \
STRIP=$(CROSS_COMPILE)strip \
NM=$(CROSS_COMPILE)nm \
$(srctree)./configure \
--build=$(build_alias) \
--host=$(host_alias) \
--with-kconfig-file=./$< \
--with-linux-dir=$(RTAI_LINUX_DIR) \
--prefix=$$CONFIG_RTAI_INSTALLDIR \
--enable-quiet-build=@CONFIG_RTAI_QUIET@ \
$$confopts ; \
if test $$? = 0; then \
touch .cfok ; \
if test x$$recf = xyes ; then \
touch .cfchanged ; \
fi ; \
else \
rm -f .cfok ; false; \
fi
if CONFIG_RTAI_OLD_FASHIONED_BUILD
clean-local:
rm -fr modules .cfchanged
distclean-local:
$(MAKE) -C $(srcdir)/base/config/kconfig \
-f Makefile.kconfig distclean srctree=$(srcdir)
find . -name autom4te.cache | xargs rm -fr
else
clean-local:
rm -f .cfchanged
distclean-local:
test -d $(top_builddir)/base/config && \
$(MAKE) -C $(top_builddir)/base/config/kconfig \
-f @abs_srcdir@/base/config/kconfig/Makefile.kconfig distclean srctree=@abs_srcdir@
endif
install-data-local: .rtai_config
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
$(INSTALL_DATA) .rtai_config $(DESTDIR)$(pkgdatadir)/config-rtai-$(VERSION)
if test -f Module.symvers ; then \
$(INSTALL_DATA) Module.symvers $(DESTDIR)$(moduledir)/Module.symvers ; \
fi
install-exec-local: devices
dist-hook:
$(MAKE) -C $(distdir)/base/config/kconfig \
-f Makefile.kconfig distclean srctree=$(distdir)
rm -fr `find $(distdir) -name CVS`
test -e $(srcdir)/doc || rm -fr $(distdir)/doc
dev devices:
@if test -r $(DESTDIR)/etc/udev/udev.rules ; then \
for f in \
$(srcdir)/base/ipc/shm/rtai_shm.udev \
$(srcdir)/base/ipc/fifos/rtai_fifos.udev \
; do \
b=`basename $$f` ; \
grep -q RTAI:`basename $$b .udev` $(DESTDIR)/etc/udev/udev.rules || \
$$sudo sh -c "( echo ; cat $$f ) >> $(DESTDIR)/etc/udev/udev.rules" ; \
done ; \
elif test -d $(DESTDIR)/etc/udev/rules.d ; then \
for f in \
$(srcdir)/base/ipc/shm/rtai_shm.udev \
$(srcdir)/base/ipc/fifos/rtai_fifos.udev \
; do \
b=`basename $$f` ; \
grep -q RTAI:`basename $$b .udev` $(DESTDIR)/etc/udev/rules.d/99-rtai.rules || \
$$sudo sh -c "( echo ; cat $$f ) >> $(DESTDIR)/etc/udev/rules.d/99-rtai.rules" ; \
done ; \
fi ; \
if test x$(DESTDIR) = x; then \
if test \! "x`type -t sudo`" = x; then sudo=sudo; else sudo=; fi; \
if test \! -c $(DESTDIR)/dev/rtai_shm; then \
$$sudo mknod -m 666 $(DESTDIR)/dev/rtai_shm c 10 254; \
fi; \
for n in `seq 0 9`; do \
f="$(DESTDIR)/dev/rtf$$n"; \
if test \! -c $$f; then \
$$sudo mknod -m 666 $$f c 150 $$n; \
fi; \
done ; \
fi
.PHONY: clean-if-reconfigured dev devices