robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 1 | # To cross compile, override one or more of CC, AR, CROSS_CFLAGS, |
robbiew | 01e94ed | 2003-06-10 22:00:26 +0000 | [diff] [blame] | 2 | # LOADLIBES, LDFLAGS, & LIB_DIR and be sure to always build from the top level. |
robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 3 | # |
| 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__" \ |
robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 8 | # 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: |
robbiew | 01e94ed | 2003-06-10 22:00:26 +0000 | [diff] [blame] | 13 | # CROSS_COMPILER=/opt/ppc64/powerpc64-linux/bin/powerpc64-linux- |
| 14 | # CROSS_CFLAGS= -mpowerpc64 |
robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 15 | # LDFLAGS=-static |
| 16 | # LOADLIBES=-lpthread -lc -lresolv -lnss_dns -lnss_files -lm -lc |
robbiew | 01e94ed | 2003-06-10 22:00:26 +0000 | [diff] [blame] | 17 | # LIB_DIR=/lib64 |
vapier | 1400d64 | 2006-02-24 02:16:55 +0000 | [diff] [blame] | 18 | # export LOADLIBES LIB_DIR |
robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 19 | # |
vapier | d4e145e | 2006-02-11 04:33:08 +0000 | [diff] [blame] | 20 | # Or, you can save all your settings into the local 'config.mk' file. |
vapier | c8b42f0 | 2007-12-22 06:34:35 +0000 | [diff] [blame] | 21 | # The defaults will not be usable in that case; you will need to |
| 22 | # override things explicitly. |
vapier | d4e145e | 2006-02-11 04:33:08 +0000 | [diff] [blame] | 23 | # |
vapier | 847ee1c | 2006-06-22 04:16:59 +0000 | [diff] [blame] | 24 | # uClinux Users: make sure you add -DUCLINUX to your CFLAGS |
| 25 | # |
robbiew | c28353f | 2003-01-10 20:04:06 +0000 | [diff] [blame] | 26 | # 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 |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 30 | |
vapier | 1400d64 | 2006-02-24 02:16:55 +0000 | [diff] [blame] | 31 | ifdef CROSS_COMPILE |
| 32 | CROSS_COMPILER = $(CROSS_COMPILE) |
| 33 | endif |
| 34 | ifdef CROSS_COMPILER |
| 35 | CC=$(CROSS_COMPILER)gcc |
| 36 | AR=$(CROSS_COMPILER)ar |
vapier | 1490030 | 2008-04-11 03:38:21 +0000 | [diff] [blame] | 37 | RANLIB=$(CROSS_COMPILER)ranlib |
vapier | 1400d64 | 2006-02-24 02:16:55 +0000 | [diff] [blame] | 38 | endif |
vapier | d4e145e | 2006-02-11 04:33:08 +0000 | [diff] [blame] | 39 | |
subrata_modak | 8dfa1b3 | 2008-07-26 04:15:36 +0000 | [diff] [blame^] | 40 | HAS_NUMA=$(shell sh tools/scripts/numa_test.sh) |
| 41 | |
vapier | 1400d64 | 2006-02-24 02:16:55 +0000 | [diff] [blame] | 42 | export CFLAGS += -Wall $(CROSS_CFLAGS) |
subrata_modak | 8dfa1b3 | 2008-07-26 04:15:36 +0000 | [diff] [blame^] | 43 | export CC AR RANLIB LDFLAGS HAS_NUMA |
vapier | 1400d64 | 2006-02-24 02:16:55 +0000 | [diff] [blame] | 44 | |
| 45 | -include config.mk |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 46 | |
robbiew | a2592be | 2001-10-12 20:49:09 +0000 | [diff] [blame] | 47 | all: libltp.a |
nstraz | f307d5f | 2000-09-14 21:54:44 +0000 | [diff] [blame] | 48 | @$(MAKE) -C pan $@ |
plars | 16dc53f | 2002-01-29 20:48:08 +0000 | [diff] [blame] | 49 | @$(MAKE) -C testcases $@ |
iyermanoj | 9652609 | 2002-12-12 16:08:47 +0000 | [diff] [blame] | 50 | @$(MAKE) -C tools $@ |
plars | 16dc53f | 2002-01-29 20:48:08 +0000 | [diff] [blame] | 51 | @echo |
| 52 | @echo "***********************************************" |
| 53 | @echo "** You now need to do a make install as root **" |
| 54 | @echo "***********************************************" |
| 55 | |
| 56 | install: all |
plars | 41c5121 | 2001-08-28 15:45:34 +0000 | [diff] [blame] | 57 | @$(MAKE) -C testcases install |
iyermanoj | 640d83c | 2002-12-20 20:00:36 +0000 | [diff] [blame] | 58 | @$(MAKE) -C tools install |
subrata_modak | 5c9f1e0 | 2008-04-02 09:24:54 +0000 | [diff] [blame] | 59 | @$(MAKE) -C lib install |
| 60 | @$(MAKE) -C include install |
| 61 | @$(MAKE) -C pan install |
| 62 | @$(MAKE) -C doc/man1 install |
| 63 | @$(MAKE) -C doc/man3 install |
| 64 | |
robbiew | 877d188 | 2003-04-23 19:50:15 +0000 | [diff] [blame] | 65 | @./IDcheck.sh |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 66 | |
| 67 | libltp.a: |
| 68 | @$(MAKE) -C lib $@ |
| 69 | |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 70 | uclinux: uclinux_libltp.a |
| 71 | #@$(MAKE) -C pan all |
| 72 | @$(MAKE) -C testcases uclinux |
| 73 | @$(MAKE) -C tools all |
| 74 | @echo |
| 75 | @echo "*******************************************************" |
| 76 | @echo "** You now need to do a make uclinux_install as root **" |
| 77 | @echo "*******************************************************" |
| 78 | |
| 79 | uclinux_install: uclinux |
| 80 | @$(MAKE) -C testcases uclinux_install |
| 81 | @$(MAKE) -C tools install |
| 82 | @./IDcheck.sh |
| 83 | |
| 84 | uclinux_libltp.a: |
| 85 | @$(MAKE) -C lib UCLINUX=1 libltp.a |
| 86 | |
robbiew | 0d77717 | 2003-04-25 16:00:26 +0000 | [diff] [blame] | 87 | menuconfig: |
| 88 | @./ltpmenu |
| 89 | |
alaffin | cc2e555 | 2000-07-27 17:13:18 +0000 | [diff] [blame] | 90 | clean: |
| 91 | @$(MAKE) -C lib $@ |
nstraz | f307d5f | 2000-09-14 21:54:44 +0000 | [diff] [blame] | 92 | @$(MAKE) -C pan $@ |
nstraz | 00f6d19 | 2001-01-22 18:05:27 +0000 | [diff] [blame] | 93 | @$(MAKE) -C tools $@ |
plars | 41c5121 | 2001-08-28 15:45:34 +0000 | [diff] [blame] | 94 | @$(MAKE) -C testcases $@ |
subrata_modak | 5c9f1e0 | 2008-04-02 09:24:54 +0000 | [diff] [blame] | 95 | |
| 96 | package: |
| 97 | rpmbuild -ba ltp-devel.spec |
| 98 | |
| 99 | |