Misha Brukman | 6d5ab86 | 2004-04-24 00:10:56 +0000 | [diff] [blame] | 1 | #===-- Makefile.common - Common make rules for LLVM --------*- Makefile -*--===# |
Misha Brukman | 9b8f542 | 2009-01-09 16:44:42 +0000 | [diff] [blame] | 2 | # |
John Criswell | d8846c1 | 2003-10-21 14:33:46 +0000 | [diff] [blame] | 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
Chris Lattner | 57360d1 | 2007-12-29 20:11:13 +0000 | [diff] [blame] | 5 | # This file is distributed under the University of Illinois Open Source |
| 6 | # License. See LICENSE.TXT for details. |
Misha Brukman | 9b8f542 | 2009-01-09 16:44:42 +0000 | [diff] [blame] | 7 | # |
Misha Brukman | 6d5ab86 | 2004-04-24 00:10:56 +0000 | [diff] [blame] | 8 | #===------------------------------------------------------------------------===# |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 9 | # |
| 10 | # This file is included by all of the LLVM makefiles. This file defines common |
Misha Brukman | 36bc642 | 2003-08-21 22:02:18 +0000 | [diff] [blame] | 11 | # rules to do things like compile a .cpp file or generate dependency info. |
| 12 | # These are platform dependent, so this is the file used to specify these |
| 13 | # system dependent operations. |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 14 | # |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 15 | # The following functionality can be set by setting incoming variables. |
| 16 | # The variable $(LEVEL) *must* be set: |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 17 | # |
Misha Brukman | 9b8f542 | 2009-01-09 16:44:42 +0000 | [diff] [blame] | 18 | # 1. LEVEL - The level of the current subdirectory from the top of the |
| 19 | # source directory. This level should be expressed as a path, for |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 20 | # example, ../.. for two levels deep. |
| 21 | # |
| 22 | # 2. DIRS - A list of subdirectories to be built. Fake targets are set up |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 23 | # so that each of the targets "all", "install", and "clean" each build |
| 24 | # the subdirectories before the local target. DIRS are guaranteed to be |
| 25 | # built in order. |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 26 | # |
Chris Lattner | a8abc22 | 2002-09-18 03:22:27 +0000 | [diff] [blame] | 27 | # 3. PARALLEL_DIRS - A list of subdirectories to be built, but that may be |
| 28 | # built in any order. All DIRS are built in order before PARALLEL_DIRS are |
| 29 | # built, which are then built in any order. |
| 30 | # |
| 31 | # 4. Source - If specified, this sets the source code filenames. If this |
Misha Brukman | 9b8f542 | 2009-01-09 16:44:42 +0000 | [diff] [blame] | 32 | # is not set, it defaults to be all of the .cpp, .c, .y, and .l files |
Chris Lattner | e001059 | 2001-10-18 01:48:09 +0000 | [diff] [blame] | 33 | # in the current directory. Also, if you want to build files in addition |
| 34 | # to the local files, you can use the ExtraSource variable |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 35 | # |
Chris Lattner | 694c5df | 2003-05-15 21:28:55 +0000 | [diff] [blame] | 36 | # 5. SourceDir - If specified, this specifies a directory that the source files |
| 37 | # are in, if they are not in the current directory. This should include a |
| 38 | # trailing / character. |
| 39 | # |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 40 | # 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree. |
Dinakar Dhurjati | 584dd18 | 2003-05-29 21:49:00 +0000 | [diff] [blame] | 41 | # |
Reid Spencer | cf61b12 | 2005-02-14 16:02:19 +0000 | [diff] [blame] | 42 | # 8. PROJ_SRC_DIR - The directory which contains the current set of Makefiles |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 43 | # and usually the source code too (unless SourceDir is set). |
| 44 | # |
Reid Spencer | cf61b12 | 2005-02-14 16:02:19 +0000 | [diff] [blame] | 45 | # 9. PROJ_SRC_ROOT - The root directory of the source code being compiled. |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 46 | # |
Reid Spencer | cf61b12 | 2005-02-14 16:02:19 +0000 | [diff] [blame] | 47 | # 10. PROJ_OBJ_DIR - The directory where object code should be placed. |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 48 | # |
Reid Spencer | cf61b12 | 2005-02-14 16:02:19 +0000 | [diff] [blame] | 49 | # 11. PROJ_OBJ_ROOT - The root directory for where object code should be |
John Criswell | 7a73b80 | 2003-06-30 21:59:07 +0000 | [diff] [blame] | 50 | # placed. |
| 51 | # |
| 52 | # For building, |
Reid Spencer | cf61b12 | 2005-02-14 16:02:19 +0000 | [diff] [blame] | 53 | # LLVM, LLVM_SRC_ROOT = PROJ_SRC_ROOT |
Chris Lattner | af06a08 | 2003-08-15 03:02:52 +0000 | [diff] [blame] | 54 | # |
Vikram S. Adve | d60aede | 2002-07-09 12:04:21 +0000 | [diff] [blame] | 55 | #===-----------------------------------------------------------------------==== |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 56 | |
John Criswell | 2a6530f | 2003-06-27 16:58:44 +0000 | [diff] [blame] | 57 | # |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 58 | # Configuration file to set paths specific to local installation of LLVM |
Misha Brukman | 9b8f542 | 2009-01-09 16:44:42 +0000 | [diff] [blame] | 59 | # |
Reid Spencer | 6ca9e44 | 2005-01-16 02:20:30 +0000 | [diff] [blame] | 60 | ifndef LLVM_OBJ_ROOT |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 61 | include $(LEVEL)/Makefile.config |
Reid Spencer | 6ca9e44 | 2005-01-16 02:20:30 +0000 | [diff] [blame] | 62 | else |
| 63 | include $(LLVM_OBJ_ROOT)/Makefile.config |
| 64 | endif |
Vikram S. Adve | c214e71 | 2002-08-29 23:28:46 +0000 | [diff] [blame] | 65 | |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 66 | # |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 67 | # Include all of the build rules used for making LLVM |
John Criswell | 8bff509 | 2003-06-11 13:55:44 +0000 | [diff] [blame] | 68 | # |
John Criswell | 7f33695 | 2003-09-06 14:44:17 +0000 | [diff] [blame] | 69 | include $(LLVM_SRC_ROOT)/Makefile.rules |
Chris Lattner | 1ddb6b6 | 2003-08-18 17:27:40 +0000 | [diff] [blame] | 70 | |