Mercurial > ecos
annotate packages/pkgconf/makrules.src @ 4:1d7f19c9e4d1 ecos-sw-1999-05-11
Merge from eCos master repository on 1999-05-11-21:11:10-BST
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 14:07:25 +0000 |
| parents | 443894e2e912 |
| children | c38311975d4f |
| rev | line source |
|---|---|
| 0 | 1 #=============================================================================== |
| 2 # | |
| 3 # makrules.src | |
| 4 # | |
| 5 # This file contains generic rules that can be applied to all src | |
| 6 # directories. | |
| 7 # | |
| 8 #=============================================================================== | |
| 9 #####COPYRIGHTBEGIN#### | |
| 10 # | |
| 11 # ------------------------------------------- | |
| 12 # The contents of this file are subject to the Cygnus eCos Public License | |
| 13 # Version 1.0 (the "License"); you may not use this file except in | |
| 14 # compliance with the License. You may obtain a copy of the License at | |
| 15 # http://sourceware.cygnus.com/ecos | |
| 16 # | |
| 17 # Software distributed under the License is distributed on an "AS IS" | |
| 18 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 19 # License for the specific language governing rights and limitations under | |
| 20 # the License. | |
| 21 # | |
| 22 # The Original Code is eCos - Embedded Cygnus Operating System, released | |
| 23 # September 30, 1998. | |
| 24 # | |
| 25 # The Initial Developer of the Original Code is Cygnus. Portions created | |
| 2 | 26 # by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 0 | 27 # ------------------------------------------- |
| 28 # | |
| 29 #####COPYRIGHTEND#### | |
| 30 #=============================================================================== | |
| 31 | |
| 32 .PHONY: default build clean | |
| 33 | |
| 34 # Source files can be picked up from the build tree or the component | |
| 35 # repository. This allows copies of the sources to be made in the | |
| 36 # build tree and edited there. | |
| 37 VPATH := . $(COMPONENT_REPOSITORY)/$($(PACKAGE)_DIR)/src | |
| 38 | |
| 39 # The object files and the dependency files can be deduced mainly | |
| 40 # from the list of source files. OTHER_OBJS and OTHER_DEPS are | |
| 41 # provided as an escape mechanism, as is OTHER_TARGETS. | |
| 42 | |
| 43 OBJECTS := $(COMPILE:.cxx=.o) | |
| 44 OBJECTS := $(OBJECTS:.c=.o) | |
| 45 OBJECTS := $(OBJECTS:.S=.o) | |
| 46 OBJECTS := $(foreach obj,$(OBJECTS),$(dir $(obj))$(PACKAGE)_$(notdir $(obj))) | |
| 47 DEPS := $(OBJECTS:.o=.d) | |
| 48 | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
49 EXTRAS_OBJECTS := $(EXTRAS_COMPILE:.cxx=.o) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
50 EXTRAS_OBJECTS := $(EXTRAS_OBJECTS:.c=.o) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
51 EXTRAS_OBJECTS := $(EXTRAS_OBJECTS:.S=.o) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
52 EXTRAS_OBJECTS := $(foreach obj,$(EXTRAS_OBJECTS),$(dir $(obj))$(PACKAGE)_$(notdir $(obj))) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
53 DEPS := $(DEPS) $(EXTRAS_OBJECTS:.o=.d) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
54 |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
55 OBJECTS := $(OBJECTS) $(OTHER_OBJS) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
56 EXTRAS_OBJECTS := $(EXTRAS_OBJECTS) $(EXTRAS_OTHER_OBJECTS) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
57 DEPS := $(DEPS) $(OTHER_DEPS) |
| 0 | 58 |
| 59 # The header file search path is as follows: | |
| 60 # | |
| 61 # $(PREFIX)/include | |
| 62 # These headers are what will be used by application code. | |
| 63 # | |
| 64 # . | |
| 65 # Header files private to a package and copied into the build tree. | |
| 66 # | |
| 67 # $(COMPONENT_REPOSITORY)/<package>/src | |
| 68 # Header files private to a package and still in the repository. | |
| 69 # | |
| 70 # It is possible for additional paths to be specified by the user, | |
| 71 # typically by editing the makevars file. Any such search paths take | |
| 72 # precedence over the default path. | |
| 73 | |
| 74 INCLUDE_PATH := $(INCLUDE_PATH) -I$(PREFIX)/include $(foreach dir,$(VPATH),-I$(dir)) | |
| 75 | |
| 76 # | |
| 77 # This is the default target. It is responsible for updating the library, | |
| 78 # building any special targets, and updating the dependency information. | |
| 79 | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
80 build: $(LIBRARY).stamp extras $(OTHER_TARGETS) |
| 0 | 81 ifneq ($(strip $(DEPS)),) |
| 82 @$(CAT) $(DEPS) > makefile.deps | |
| 83 endif | |
| 84 | |
| 85 | |
| 86 # Updating the library involves using ar with any object files that | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
87 # have been rebuilt. A few packages may not involve any object files |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
88 # at all. |
| 0 | 89 |
| 90 $(LIBRARY).stamp: $(OBJECTS) | |
| 91 ifneq ($(strip $(OBJECTS)),) | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
92 $(AR) rcs $(PREFIX)/lib/$(LIBRARY) $? |
| 0 | 93 endif |
| 94 $(TOUCH) $@ | |
| 95 | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
96 # Updating libextras.a may or may not be a no-op, many packages |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
97 # will not want to put anything there. |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
98 .PHONY: extras |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
99 ifeq ($(strip $(EXTRAS_OBJECTS)),) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
100 extras: |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
101 else |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
102 extras: $(PREFIX)/lib/libextras.a($(EXTRAS_OBJECTS)) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
103 endif |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
104 |
| 0 | 105 # The clean target cleans up the intermediate files, any object |
| 106 # files, and any dependency files. | |
| 107 | |
| 108 clean: $(OTHER_CLEAN) | |
| 109 $(RM) $(LIBRARY).stamp | |
| 110 @$(RM) makefile.deps | |
| 111 ifneq ($(strip $(OBJECTS)),) | |
| 112 $(RM) $(OBJECTS) | |
| 113 endif | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
114 ifneq ($(strip $(EXTRAS_OBJECTS)),) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
115 $(RM) $(EXTRAS_OBJECTS) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
116 endif |
| 0 | 117 ifneq ($(strip $(DEPS)),) |
| 118 @$(RM) $(DEPS) | |
| 119 endif | |
| 120 | |
| 121 # | |
| 122 # These file dependencies ensure that all files are rebuilt if | |
| 123 # there is a change to the build environment, e.g. if a different | |
| 124 # compiler is being used. | |
| 125 # | |
| 126 ifneq ($(strip $(OBJECTS)),) | |
| 127 $(OBJECTS) : $(BUILD_TREE)/pkgconf/pkgconf.mak | |
| 128 $(OBJECTS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) | |
| 129 endif | |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
130 ifneq ($(strip $(EXTRAS_OBJECTS)),) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
131 $(EXTRAS_OBJECTS) : $(BUILD_TREE)/pkgconf/pkgconf.mak |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
132 $(EXTRAS_OBJECTS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
133 endif |
| 0 | 134 ifneq ($(strip $(OTHER_TARGETS)),) |
| 135 $(OTHER_TARGETS) : $(BUILD_TREE)/pkgconf/pkgconf.mak | |
| 136 $(OTHER_TARGETS) : $(BUILD_TREE)/pkgconf/makevars $(PACKAGE_RULES_FILE) | |
| 137 endif | |
| 138 | |
| 139 # | |
| 140 # This rule reads in any previously generated dependency information. | |
| 141 # | |
| 142 ifneq ($(wildcard makefile.deps),) | |
| 143 include makefile.deps | |
| 144 endif | |
| 145 | |
| 146 |
