blob: 953eddf88007b4c7dff2e17a643ab2ce528df6bb [file] [log] [blame]
vapier36ab22f2009-01-19 03:37:35 +00001# See toplevel INSTALL for build info
alaffincc2e5552000-07-27 17:13:18 +00002
vapier1400d642006-02-24 02:16:55 +00003ifdef CROSS_COMPILE
4CROSS_COMPILER = $(CROSS_COMPILE)
5endif
6ifdef CROSS_COMPILER
7CC=$(CROSS_COMPILER)gcc
8AR=$(CROSS_COMPILER)ar
vapier14900302008-04-11 03:38:21 +00009RANLIB=$(CROSS_COMPILER)ranlib
vapier1400d642006-02-24 02:16:55 +000010endif
vapierd4e145e2006-02-11 04:33:08 +000011
subrata_modak8dfa1b32008-07-26 04:15:36 +000012HAS_NUMA=$(shell sh tools/scripts/numa_test.sh)
13
vapier1400d642006-02-24 02:16:55 +000014export CFLAGS += -Wall $(CROSS_CFLAGS)
vapier361210d2008-09-24 04:38:34 +000015export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
vapier1400d642006-02-24 02:16:55 +000016
yaberauneya3ab801e2009-07-10 23:01:27 +000017# SKIP_IDCHECK != 1, defaults to previous behavior, which is to execute
18# IDcheck.sh at the end of `make install'.
19SKIP_IDCHECK ?= 0
20
vapier1400d642006-02-24 02:16:55 +000021-include config.mk
alaffincc2e5552000-07-27 17:13:18 +000022
subrata_modak3d8666c2008-11-11 08:31:27 +000023VPATH += include m4
vapierff5a9a82009-01-20 14:41:39 +000024all: config.h config.mk libltp.a
nstrazf307d5f2000-09-14 21:54:44 +000025 @$(MAKE) -C pan $@
plars16dc53f2002-01-29 20:48:08 +000026 @$(MAKE) -C testcases $@
iyermanoj96526092002-12-12 16:08:47 +000027 @$(MAKE) -C tools $@
subrata_modakfcab26f2009-03-25 06:17:48 +000028 @$(MAKE) -C utils $@
plars16dc53f2002-01-29 20:48:08 +000029 @echo
30 @echo "***********************************************"
31 @echo "** You now need to do a make install as root **"
32 @echo "***********************************************"
33
34install: all
plars41c51212001-08-28 15:45:34 +000035 @$(MAKE) -C testcases install
iyermanoj640d83c2002-12-20 20:00:36 +000036 @$(MAKE) -C tools install
subrata_modak5c9f1e02008-04-02 09:24:54 +000037 @$(MAKE) -C lib install
38 @$(MAKE) -C include install
39 @$(MAKE) -C pan install
subrata_modak3d8666c2008-11-11 08:31:27 +000040 @$(MAKE) -C m4 install
subrata_modak5c9f1e02008-04-02 09:24:54 +000041 @$(MAKE) -C doc/man1 install
42 @$(MAKE) -C doc/man3 install
yaberauneya3ab801e2009-07-10 23:01:27 +000043ifneq ($(strip $(SKIP_IDCHECK)),1)
robbiew877d1882003-04-23 19:50:15 +000044 @./IDcheck.sh
yaberauneya3ab801e2009-07-10 23:01:27 +000045endif
alaffincc2e5552000-07-27 17:13:18 +000046
vapierfe018f02008-11-12 19:30:36 +000047libltp.a: config.h
alaffincc2e5552000-07-27 17:13:18 +000048 @$(MAKE) -C lib $@
49
robbiewd34d5812005-07-11 22:28:09 +000050uclinux: uclinux_libltp.a
51 #@$(MAKE) -C pan all
52 @$(MAKE) -C testcases uclinux
53 @$(MAKE) -C tools all
54 @echo
55 @echo "*******************************************************"
56 @echo "** You now need to do a make uclinux_install as root **"
57 @echo "*******************************************************"
58
59uclinux_install: uclinux
60 @$(MAKE) -C testcases uclinux_install
61 @$(MAKE) -C tools install
yaberauneya3ab801e2009-07-10 23:01:27 +000062ifneq ($(strip $(SKIP_IDCHECK)),1)
robbiewd34d5812005-07-11 22:28:09 +000063 @./IDcheck.sh
yaberauneya3ab801e2009-07-10 23:01:27 +000064endif
robbiewd34d5812005-07-11 22:28:09 +000065
66uclinux_libltp.a:
67 @$(MAKE) -C lib UCLINUX=1 libltp.a
68
robbiew0d777172003-04-25 16:00:26 +000069menuconfig:
70 @./ltpmenu
71
vapierfe018f02008-11-12 19:30:36 +000072clean: ac-clean
alaffincc2e5552000-07-27 17:13:18 +000073 @$(MAKE) -C lib $@
nstrazf307d5f2000-09-14 21:54:44 +000074 @$(MAKE) -C pan $@
nstraz00f6d192001-01-22 18:05:27 +000075 @$(MAKE) -C tools $@
plars41c51212001-08-28 15:45:34 +000076 @$(MAKE) -C testcases $@
subrata_modakfcab26f2009-03-25 06:17:48 +000077 @$(MAKE) -C utils $@
subrata_modak5c9f1e02008-04-02 09:24:54 +000078
vapierfe018f02008-11-12 19:30:36 +000079distclean: clean ac-distclean
subrata_modak3d8666c2008-11-11 08:31:27 +000080 @$(MAKE) -C include $@
81
vapierfe018f02008-11-12 19:30:36 +000082maintainer-clean: distclean ac-maintainer-clean
subrata_modak3d8666c2008-11-11 08:31:27 +000083 @$(MAKE) -C include $@
84
subrata_modak5c9f1e02008-04-02 09:24:54 +000085package:
86 rpmbuild -ba ltp-devel.spec
87
88
subrata_modak3d8666c2008-11-11 08:31:27 +000089#
vapierfe018f02008-11-12 19:30:36 +000090# Autotools related
subrata_modak3d8666c2008-11-11 08:31:27 +000091#
vapierdf8759f2009-01-18 22:22:40 +000092.PHONY: autotools
93autotools: aclocal autoconf autoheader automake
94
95.PHONY: aclocal
96aclocal: aclocal.m4
97aclocal.m4: $(wildcard m4/*.m4)
98 aclocal -I m4
99
subrata_modakbe2f1a52008-11-25 14:34:04 +0000100.PHONY: autoconf
vapierdf8759f2009-01-18 22:22:40 +0000101autoconf: configure
102configure: configure.ac aclocal.m4
vapierfe018f02008-11-12 19:30:36 +0000103 autoconf
subrata_modak3d8666c2008-11-11 08:31:27 +0000104
vapierdf8759f2009-01-18 22:22:40 +0000105.PHONY: autoheader
106autoheader: config.h.in
107config.h.in: configure.ac $(wildcard m4/*.m4)
subrata_modak3d8666c2008-11-11 08:31:27 +0000108 autoheader
vapierdf8759f2009-01-18 22:22:40 +0000109 touch include/$@
vapierfe018f02008-11-12 19:30:36 +0000110config.h: config.h.default
111 cp include/config.h.default include/config.h
vapierff5a9a82009-01-20 14:41:39 +0000112config.mk:
113 touch $@
subrata_modak3d8666c2008-11-11 08:31:27 +0000114
vapierdf8759f2009-01-18 22:22:40 +0000115.PHONY: automake
116AUTOMAKE_FILES = config.guess config.sub install-sh missing
117automake: aclocal $(AUTOMAKE_FILES)
118$(AUTOMAKE_FILES): m4/Makefile.in
119m4/Makefile.in: m4/Makefile.am
120 automake -c -a
121
122.PHONY: ac-clean ac-distclean ac-maintainer-clean
vapierfe018f02008-11-12 19:30:36 +0000123ac-clean:
subrata_modak3d8666c2008-11-11 08:31:27 +0000124 rm -rf autom4te.cache
vapierfe018f02008-11-12 19:30:36 +0000125 rm -f config.log config.status
126ac-distclean: ac-clean
127ac-maintainer-clean: ac-distclean
vapierdf8759f2009-01-18 22:22:40 +0000128 rm -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
subrata_modakaba85b92008-12-11 10:30:33 +0000129
130#
131# Help
132#
133.PHONY: help
134help:
135 @echo
136 @echo 'About configuration'
137 @echo '-------------------'
138 @echo 'If you want to use auto configuration, '
subrata_modak3960cc82009-01-20 10:47:29 +0000139 @echo 'be sure autoconf and automake are installed. Then run: '
140 @echo ' $$ make autotools '
subrata_modakaba85b92008-12-11 10:30:33 +0000141 @echo ' $$ ./configure '
142 @echo ' $$ make all '
143 @echo
144 @echo 'If you want to use default configuration, '
145 @echo 'autoconf is not needed. Just run: '
146 @echo ' $$ touch include/config.h.default '
147 @echo ' $$ make config.h '
148 @echo ' $$ make all '
149 @echo
150 @echo 'If make all is failed even if you use the '
151 @echo 'auto configuration, please, report it to '
152 @echo 'ltp developers with config.log, generated '
153 @echo 'by running the configure script. '
154 @echo