blob: b7c18075841ecb21a4a82f79ba0ee05ddbf75025 [file] [log] [blame]
robbiewc28353f2003-01-10 20:04:06 +00001# To cross compile, override one or more of CC, AR, CROSS_CFLAGS,
robbiew01e94ed2003-06-10 22:00:26 +00002# LOADLIBES, LDFLAGS, & LIB_DIR and be sure to always build from the top level.
robbiewc28353f2003-01-10 20:04:06 +00003#
4# To override them from the make commandline, do something like this:
5# $ CROSS_COMPILER=/opt/cegl-1.4/hardhat/devkit/ppc/405/bin/powerpc-linux-
6# $ make \
7# CROSS_CFLAGS="-mcpu=403 -D__PPC405__" \
robbiewc28353f2003-01-10 20:04:06 +00008# LDFLAGS=-static \
9# LOADLIBES="-lpthread -lc -lresolv -lnss_dns -lnss_files -lm -lc"
10#
11# Alternately, to override them by editing this file, uncomment the
12# following lines:
robbiew01e94ed2003-06-10 22:00:26 +000013# CROSS_COMPILER=/opt/ppc64/powerpc64-linux/bin/powerpc64-linux-
14# CROSS_CFLAGS= -mpowerpc64
robbiewc28353f2003-01-10 20:04:06 +000015# LDFLAGS=-static
16# LOADLIBES=-lpthread -lc -lresolv -lnss_dns -lnss_files -lm -lc
robbiew01e94ed2003-06-10 22:00:26 +000017# LIB_DIR=/lib64
vapier1400d642006-02-24 02:16:55 +000018# export LOADLIBES LIB_DIR
robbiewc28353f2003-01-10 20:04:06 +000019#
vapierd4e145e2006-02-11 04:33:08 +000020# Or, you can save all your settings into the local 'config.mk' file.
vapierc8b42f02007-12-22 06:34:35 +000021# The defaults will not be usable in that case; you will need to
22# override things explicitly.
vapierd4e145e2006-02-11 04:33:08 +000023#
vapier847ee1c2006-06-22 04:16:59 +000024# uClinux Users: make sure you add -DUCLINUX to your CFLAGS
25#
robbiewc28353f2003-01-10 20:04:06 +000026# Note: If you override a variable from the commandline all
27# assignments to it in the Makefiles will be ignored. To set it both
28# in the commandline and in the Makefiles use a dummy variable like in
29# CFLAGS
alaffincc2e5552000-07-27 17:13:18 +000030
vapier1400d642006-02-24 02:16:55 +000031ifdef CROSS_COMPILE
32CROSS_COMPILER = $(CROSS_COMPILE)
33endif
34ifdef CROSS_COMPILER
35CC=$(CROSS_COMPILER)gcc
36AR=$(CROSS_COMPILER)ar
vapier14900302008-04-11 03:38:21 +000037RANLIB=$(CROSS_COMPILER)ranlib
vapier1400d642006-02-24 02:16:55 +000038endif
vapierd4e145e2006-02-11 04:33:08 +000039
subrata_modak8dfa1b32008-07-26 04:15:36 +000040HAS_NUMA=$(shell sh tools/scripts/numa_test.sh)
41
vapier1400d642006-02-24 02:16:55 +000042export CFLAGS += -Wall $(CROSS_CFLAGS)
vapier361210d2008-09-24 04:38:34 +000043export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
vapier1400d642006-02-24 02:16:55 +000044
45-include config.mk
alaffincc2e5552000-07-27 17:13:18 +000046
subrata_modak3d8666c2008-11-11 08:31:27 +000047VPATH += include m4
48all: config.h libltp.a
nstrazf307d5f2000-09-14 21:54:44 +000049 @$(MAKE) -C pan $@
plars16dc53f2002-01-29 20:48:08 +000050 @$(MAKE) -C testcases $@
iyermanoj96526092002-12-12 16:08:47 +000051 @$(MAKE) -C tools $@
plars16dc53f2002-01-29 20:48:08 +000052 @echo
53 @echo "***********************************************"
54 @echo "** You now need to do a make install as root **"
55 @echo "***********************************************"
56
57install: all
plars41c51212001-08-28 15:45:34 +000058 @$(MAKE) -C testcases install
iyermanoj640d83c2002-12-20 20:00:36 +000059 @$(MAKE) -C tools install
subrata_modak5c9f1e02008-04-02 09:24:54 +000060 @$(MAKE) -C lib install
61 @$(MAKE) -C include install
62 @$(MAKE) -C pan install
subrata_modak3d8666c2008-11-11 08:31:27 +000063 @$(MAKE) -C m4 install
subrata_modak5c9f1e02008-04-02 09:24:54 +000064 @$(MAKE) -C doc/man1 install
65 @$(MAKE) -C doc/man3 install
66
robbiew877d1882003-04-23 19:50:15 +000067 @./IDcheck.sh
alaffincc2e5552000-07-27 17:13:18 +000068
69libltp.a:
70 @$(MAKE) -C lib $@
71
robbiewd34d5812005-07-11 22:28:09 +000072uclinux: uclinux_libltp.a
73 #@$(MAKE) -C pan all
74 @$(MAKE) -C testcases uclinux
75 @$(MAKE) -C tools all
76 @echo
77 @echo "*******************************************************"
78 @echo "** You now need to do a make uclinux_install as root **"
79 @echo "*******************************************************"
80
81uclinux_install: uclinux
82 @$(MAKE) -C testcases uclinux_install
83 @$(MAKE) -C tools install
84 @./IDcheck.sh
85
86uclinux_libltp.a:
87 @$(MAKE) -C lib UCLINUX=1 libltp.a
88
robbiew0d777172003-04-25 16:00:26 +000089menuconfig:
90 @./ltpmenu
91
subrata_modak3d8666c2008-11-11 08:31:27 +000092clean: dist-clean ac-dist-clean
alaffincc2e5552000-07-27 17:13:18 +000093 @$(MAKE) -C lib $@
nstrazf307d5f2000-09-14 21:54:44 +000094 @$(MAKE) -C pan $@
nstraz00f6d192001-01-22 18:05:27 +000095 @$(MAKE) -C tools $@
plars41c51212001-08-28 15:45:34 +000096 @$(MAKE) -C testcases $@
subrata_modak5c9f1e02008-04-02 09:24:54 +000097
subrata_modak3d8666c2008-11-11 08:31:27 +000098dist-clean: clean ac-dist-clean
99 @$(MAKE) -C include $@
100
101maintainer-clean: dist-clean ac-maintainer-clean
102 @$(MAKE) -C include $@
103
subrata_modak5c9f1e02008-04-02 09:24:54 +0000104package:
105 rpmbuild -ba ltp-devel.spec
106
107
subrata_modak3d8666c2008-11-11 08:31:27 +0000108#
109# Autoconf related
110#
111config.h: config.h.in configure
112 ./configure
113
114config.h.in: configure.ac
115 autoheader
116
117configure: configure.ac $(notdir $(wildcard m4/*.m4))
118 autoconf
119
120.PHONY: ac-dist-clean ac-maintainer-clean
121ac-dist-clean:
122 rm -rf autom4te.cache
123 rm -f config.log config.status
124
125ac-maintainer-clean:
126 rm -f configure