www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / kernel / linux / scripts / kconfig / Makefile
1 # ===========================================================================
2 # Kernel configuration targets
3 # These targets are used from top-level makefile
4
5 .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig
6
7 xconfig: $(obj)/qconf
8         $< arch/$(ARCH)/Kconfig
9
10 gconfig: $(obj)/gconf
11         $< arch/$(ARCH)/Kconfig
12
13 menuconfig: $(obj)/mconf
14         $(Q)$(MAKE) $(build)=scripts/lxdialog
15         $< arch/$(ARCH)/Kconfig
16
17 config: $(obj)/conf
18         $< arch/$(ARCH)/Kconfig
19
20 oldconfig: $(obj)/conf
21         $< -o arch/$(ARCH)/Kconfig
22
23 silentoldconfig: $(obj)/conf
24         $< -s arch/$(ARCH)/Kconfig
25
26 .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
27
28 randconfig: $(obj)/conf
29         $< -r arch/$(ARCH)/Kconfig
30
31 allyesconfig: $(obj)/conf
32         $< -y arch/$(ARCH)/Kconfig
33
34 allnoconfig: $(obj)/conf
35         $< -n arch/$(ARCH)/Kconfig
36
37 allmodconfig: $(obj)/conf
38         $< -m arch/$(ARCH)/Kconfig
39
40 defconfig: $(obj)/conf
41         $< -d arch/$(ARCH)/Kconfig
42
43 %_defconfig: $(obj)/conf
44         $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
45
46 # Help text used by make help
47 help:
48         @echo  '  oldconfig       - Update current config utilising a line-oriented program'
49         @echo  '  menuconfig      - Update current config utilising a menu based program'
50         @echo  '  xconfig         - Update current config utilising a QT based front-end'
51         @echo  '  gconfig         - Update current config utilising a GTK based front-end'
52         @echo  '  defconfig       - New config with default answer to all options'
53         @echo  '  allmodconfig    - New config selecting modules when possible'
54         @echo  '  allyesconfig    - New config where all options are accepted with yes'
55         @echo  '  allnoconfig     - New minimal config'
56
57 # ===========================================================================
58 # Shared Makefile for the various kconfig executables:
59 # conf:   Used for defconfig, oldconfig and related targets
60 # mconf:  Used for the mconfig target.
61 #         Utilizes the lxdialog package
62 # qconf:  Used for the xconfig target
63 #         Based on QT which needs to be installed to compile it
64 # gconf:  Used for the gconfig target
65 #         Based on GTK which needs to be installed to compile it
66 # object files used by all kconfig flavours
67
68 libkconfig-objs := zconf.tab.o
69
70 host-progs      := conf mconf qconf gconf
71 conf-objs       := conf.o  libkconfig.so
72 mconf-objs      := mconf.o libkconfig.so
73
74 ifeq ($(MAKECMDGOALS),xconfig)
75         qconf-target := 1
76 endif
77 ifeq ($(MAKECMDGOALS),gconfig)
78         gconf-target := 1
79 endif
80
81
82 ifeq ($(qconf-target),1)
83 qconf-cxxobjs   := qconf.o
84 qconf-objs      := kconfig_load.o
85 endif
86
87 ifeq ($(gconf-target),1)
88 gconf-objs      := gconf.o kconfig_load.o
89 endif
90
91 clean-files     := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \
92                    .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
93
94 # generated files seem to need this to find local include files
95 HOSTCFLAGS_lex.zconf.o  := -I$(src)
96 HOSTCFLAGS_zconf.tab.o  := -I$(src)
97
98 HOSTLOADLIBES_qconf     = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
99 HOSTCXXFLAGS_qconf.o    = -I$(QTDIR)/include 
100
101 HOSTLOADLIBES_gconf     = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
102 HOSTCFLAGS_gconf.o      = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
103
104 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
105
106 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
107
108 ifeq ($(qconf-target),1)
109 MOC = $(QTDIR)/bin/moc
110 QTLIBPATH = $(QTDIR)/lib
111 -include $(obj)/.tmp_qtcheck
112
113 # QT needs some extra effort...
114 $(obj)/.tmp_qtcheck:
115         @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
116           if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
117         done; \
118         if [ -z "$$DIR" ]; then \
119           echo "*"; \
120           echo "* Unable to find the QT installation. Please make sure that the"; \
121           echo "* QT development package is correctly installed and the QTDIR"; \
122           echo "* environment variable is set to the correct location."; \
123           echo "*"; \
124           false; \
125         fi; \
126         LIBPATH=$$DIR/lib; LIB=qt; \
127         $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
128           LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
129         if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
130         echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
131         echo "QTLIB=$$LIB" >> $@; \
132         if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
133           echo "*"; \
134           echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
135           echo "*"; \
136           echo "MOC=/usr/bin/moc" >> $@; \
137         fi
138 endif
139
140 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
141
142 ifeq ($(gconf-target),1)
143 -include $(obj)/.tmp_gtkcheck
144
145 # GTK needs some extra effort, too...
146 $(obj)/.tmp_gtkcheck:
147         @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then               \
148                 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then                  \
149                         touch $@;                                                               \
150                 else                                                                    \
151                         echo "*";                                                       \
152                         echo "* GTK+ is present but version >= 2.0.0 is required.";     \
153                         echo "*";                                                       \
154                         false;                                                          \
155                 fi                                                                      \
156         else                                                                            \
157                 echo "*";                                                               \
158                 echo "* Unable to find the GTK+ installation. Please make sure that";   \
159                 echo "* the GTK+ 2.0 development package is correctly installed...";    \
160                 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0.";                 \
161                 echo "*";                                                               \
162                 false;                                                                  \
163         fi
164 endif
165
166 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
167
168 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
169
170 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
171
172 $(obj)/gconf.o: $(obj)/lkc_defs.h
173
174 $(obj)/%.moc: $(src)/%.h
175         $(MOC) -i $< -o $@
176
177 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
178         sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
179
180
181 ###
182 # The following requires flex/bison
183 # By default we use the _shipped versions, uncomment the following line if
184 # you are modifying the flex/bison src.
185 # LKC_GENPARSER := 1
186
187 ifdef LKC_GENPARSER
188
189 $(obj)/zconf.tab.c: $(obj)/zconf.y 
190 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
191
192 %.tab.c: %.y
193         bison -t -d -v -b $* -p $(notdir $*) $<
194
195 lex.%.c: %.l
196         flex -P$(notdir $*) -o$@ $<
197
198 endif