Changeset 927af3af in mainline
- Timestamp:
- 2011-05-29T16:04:26Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df56f5c
- Parents:
- d1671a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/binutils/Makefile
rd1671a8 r927af3af 61 61 62 62 # AWK script which generates patched Makefile.common. 63 PATCH_SCRIPT= ./patch.awk63 MAKEFILE_PATCH = ./patch.awk 64 64 65 65 # Compilers that can be used to build binutils. … … 68 68 # Patched Makefile.common for ported user space applications. 69 69 include $(COMMON_MAKEFILE_PATCHED) 70 71 # Patch $PATH to intercept toolchain calls. 72 PATH := $(PWD):$(PATH) 73 74 # Shell script for false toolchain generation. 75 TOOLCHAIN_SCRIPT = ./toolchain.sh 76 77 # False toolchain. 78 TOOLCHAIN = ./gcc ./as ./ar ./ranlib ./ld ./objdump ./objcopy ./strip 79 80 # Stamp indicating whether the binutils source tree is patched. 81 BINUTILS_PATCHED = ./done 82 83 # Shell script for instrusive patches of binutils source tree. 84 BINUTILS_PATCH = ./intrusive.sh 85 86 # Detection whether the binutils are already configured. 87 BINUTILS_CONFIGURED = $(REDIST_DIR)/Makefile 70 88 71 89 # Map the HelenOS target to binutils target. … … 99 117 MAKE_TARGETS = all-gas all-ld 100 118 101 # Patch native Makefile.common.102 # Download and extract binutils.103 119 # Check presence of gcc compiler. 104 # Patch $PATH to intercept toolchain calls.105 # Generate false toolchain.106 # Patch binutils.107 # Configure binutils for target architecture.108 120 # Make binutils. 109 121 # Copy binaries. 110 all: $(COMMON_MAKEFILE_PATCHED) all_ $(REDIST_FILENAME) $(REDIST_DETECT)111 122 ifeq ($(COMPILER),$(findstring $(COMPILER),$(SUPPORTED_COMPILERS))) 112 OLDPATH = $(PATH) 113 PATH = $(PWD):$(PATH)123 all: $(COMMON_MAKEFILE_PATCHED) all_ $(TOOLCHAIN) $(BINUTILS_PATCHED) \ 124 $(BINUTILS_CONFIGURED) $(REDIST_DETECT) 114 125 export PATH 115 ./toolchain.sh gcc $(CC) '$(CFLAGS)' 116 ./toolchain.sh as $(AS) 117 ./toolchain.sh ar $(AR) 118 ./toolchain.sh ranlib 119 ./toolchain.sh ld $(LD) '$(LFLAGS)' '$(LINKER_SCRIPT)' '$(LIBS) $(BASE_LIBS)' 120 ./toolchain.sh objdump $(OBJDUMP) 121 ./toolchain.sh objcopy $(OBJCOPY) 122 ./toolchain.sh strip $(STRIP) 123 ./intrusive.sh do $(REDIST_DIR) 124 ORIG_DIR = $(subst $(space),\ ,$(PWD)) 125 cd $(REDIST_DIR) 126 ./configure --target=$(TARGET) $(CONF_FLAGS) 127 make $(MAKE_TARGETS) 128 cd $(ORIG_DIR) 129 cp $(REDIST_DIR)/gas/as-new ./as 130 cp $(REDIST_DIR)/ld/ld-new ./ld 131 PATH = $(OLDPATH) 132 export PATH 126 make -C $(REDIST_DIR) $(MAKE_TARGETS) 127 cp -f $(REDIST_DIR)/gas/as-new ./as 128 cp -f $(REDIST_DIR)/ld/ld-new ./ld 133 129 else 134 echo 'Skipped: Cannot build binutils with unsupported compiler.' 130 all: 131 # Skipped: Cannot build binutils with unsupported compiler. 135 132 endif 136 133 137 134 # Create patched Makefile.common from native Makefile.common. 138 $(COMMON_MAKEFILE_PATCHED): $( PATCH_SCRIPT) $(COMMON_MAKEFILE_NATIVE)135 $(COMMON_MAKEFILE_PATCHED): $(MAKEFILE_PATCH) $(COMMON_MAKEFILE_NATIVE) 139 136 awk -f $^ > $@ 140 137 … … 148 145 mv -f $(REDIST_NAME) $(REDIST_DIR) 149 146 147 # Generate false toolchain scripts. 148 $(TOOLCHAIN): $(TOOLCHAIN_SCRIPT) 149 $^ gcc $(CC) '$(CFLAGS)' 150 $^ as $(AS) 151 $^ ar $(AR) 152 $^ ranlib 153 $^ ld $(LD) '$(LFLAGS)' '$(LINKER_SCRIPT)' '$(LIBS) $(BASE_LIBS)' 154 $^ objdump $(OBJDUMP) 155 $^ objcopy $(OBJCOPY) 156 $^ strip $(STRIP) 157 158 # Patch binutils source tree. 159 $(BINUTILS_PATCHED): $(BINUTILS_PATCH) $(REDIST_DETECT) 160 $^ do $(REDIST_DIR) 161 touch $@ 162 163 # Configure binutils. 164 $(BINUTILS_CONFIGURED): $(REDIST_DIR)/configure $(REDIST_DETECT) 165 $^ --target=$(TARGET) $(CONF_FLAGS) 166 150 167 # Delete binaries. 151 168 # Clean binutils. … … 154 171 clean: 155 172 rm -f as ld 156 ORIG_DIR = $(subst $(space),\ ,$(PWD)) 157 cd $(REDIST_DIR) 158 make distclean 159 cd $(ORIG_DIR) 173 make -C $(REDIST_DIR) distclean 160 174 ./intrusive.sh undo $(REDIST_DIR) 161 rm -f gcc as ar ranlib ld objdump objcopy strip 175 rm -f $(BINUTILS_PATCHED) 176 rm -f $(TOOLCHAIN) 162 177 rm -f $(COMMON_MAKEFILE_PATCHED) 163 178
Note:
See TracChangeset
for help on using the changeset viewer.