ifndef CoreOSMakefiles
CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
endif
include $(CoreOSMakefiles)/Standard/Standard.make
USE_APPLE_PB_SUPPORT = all
HOSTS = ppc i386 targets = echo $${TARGETS:-'ppc i386'}
TARGETS := $(shell $(targets))
RC_ARCHS = $(HOSTS)
SRCROOT = .
SRC = `cd $(SRCROOT) && pwd | sed s,/private,,`
OBJROOT = $(SRC)/obj
SYMROOT = $(OBJROOT)/../sym
DSTROOT = $(OBJROOT)/../dst
BOOTSTRAP = --bootstrap
ENABLE_CHECKING=
ifeq ($(ENABLE_CHECKING),)
ENABLE_CHECKING1 = --disable-checking
else
ifeq ($(ENABLE_CHECKING),--disable-checking)
ENABLE_CHECKING1 = --disable-checking
else
ENABLE_CHECKING1 = --enable-checking
endif
endif
VERSION = 3.1
ARCH = `arch`
PREFIX = /usr
std_include_dir = $(DSTROOT)/usr/include
gcc_hdr_dir = $(std_include_dir)/gcc/darwin/$(VERSION)
gcc_man1_dir = $(DSTROOT)/usr/share/man/man1
DO_SYMLINKS = no
DO_HDR_SYMLINKS = no
OPTIMIZE =
install: installhdrs build install_no_src @echo
@echo ++++++++++++++
@echo + Installing +
@echo ++++++++++++++
@echo
if [ "$(DO_SYMLINKS)" = yes ]; then \
cd $(DSTROOT)/usr/libexec/gcc/darwin && \
for dir in *; do \
cd $(DSTROOT)/usr/libexec/gcc/darwin/$$dir && \
rm -f default && \
ln -s $(VERSION) default; \
done && \
cd $(DSTROOT)/usr/lib/gcc/darwin && \
rm -f default && \
ln -s $(VERSION) default; \
fi
installhdrs: DSTROOT @echo
@echo ++++++++++++++++++++++
@echo + Installing headers +
@echo ++++++++++++++++++++++
@echo
mkdir -p $(gcc_hdr_dir)
mkdir -p $(gcc_hdr_dir)/machine
if [ "$(DO_HDR_SYMLINKS)" = yes ]; then \
mkdir -p $(std_include_dir)/machine && \
rm -f $(std_include_dir)/gcc/darwin/default && \
ln -s $(VERSION) $(std_include_dir)/gcc/darwin/default; \
fi
for file in gcc/ginclude/stdarg.h \
gcc/ginclude/varargs.h \
gcc/ginclude/stdbool.h \
`ls more-hdrs/*.h`; do \
install -c -m 444 $$file $(gcc_hdr_dir) && \
if [ "$(DO_HDR_SYMLINKS)" = yes -a \
"$$file" != "more-hdrs/ppc_intrinsics.h" ]; then \
file1=$${file##*/} && \
rm -f $(std_include_dir)/$$file1 && \
ln -s gcc/darwin/default/$$file1 $(std_include_dir); \
fi \
done
rm -f /tmp/float.$$$$ && \
more-hdrs/synthesize-float $(SRC) /tmp/float.$$$$ $(RC_RELEASE) && \
install -c -m 444 /tmp/float.$$$$ $(gcc_hdr_dir)/float.h && \
if [ "$(DO_HDR_SYMLINKS)" = yes ]; then \
rm -f $(std_include_dir)/float.h && \
ln -s gcc/darwin/default/float.h $(std_include_dir); \
fi && \
rm -f /tmp/float.$$$$ && \
rm -f /tmp/limits.$$$$ && \
more-hdrs/synthesize-limits $(SRC) /tmp/limits.$$$$ && \
install -c -m 444 /tmp/limits.$$$$ $(gcc_hdr_dir)/machine/limits.h && \
rm -f /tmp/limits.$$$$
if [ "$(DO_HDR_SYMLINKS)" = yes ]; then \
rm -f $(std_include_dir)/machine/limits.h && \
ln -s ../gcc/darwin/default/machine/limits.h $(std_include_dir)/machine; \
fi
build: OBJROOT SYMROOT
@echo
@echo +++++++++
@echo + build +
@echo +++++++++
@echo
APPLE_CC=`if echo $(SRCROOT) | grep '[0-9]$$' >/dev/null; then \
vers_string -f cc 2>/dev/null | sed -e 's/[-A-Za-z_]*//' \
| sed -e 's/\.[0-9.]*//'; \
else date +%Y%m%d%H%M%S; \
fi`; \
export APPLE_CC; \
./build_gcc --thins \
--srcroot=$(SRC) \
--dstroot=$(DSTROOT) \
--objroot=$(OBJROOT) \
--symroot=$(SYMROOT) \
--cflags="$(RC_CFLAGS) $(OTHER_CFLAGS) -g" \
--hosts="$(RC_ARCHS)" \
--targets="$(TARGETS)" \
--prefix="$(PREFIX)" \
--symlinks=$(DO_SYMLINKS) \
--optimize="$(OPTIMIZE)" \
$(ENABLE_CHECKING1) \
$(BOOTSTRAP)
install_no_src:
@echo
@echo ++++++++++++++++++
@echo + install_no_src +
@echo ++++++++++++++++++
@echo
APPLE_CC=`if echo $(SRCROOT) | grep '[0-9]$$' >/dev/null; then \
vers_string -f cc 2>/dev/null | sed -e 's/[-A-Za-z_]*//' \
| sed -e 's/\.[0-9.]*//'; \
else date +%Y%m%d%H%M%S; \
fi`; \
export APPLE_CC; \
./build_gcc --fats \
--srcroot=$(SRC) \
--dstroot=$(DSTROOT) \
--objroot=$(OBJROOT) \
--symroot=$(SYMROOT) \
--cflags="$(RC_CFLAGS) $(OTHER_CFLAGS)" \
--hosts="$(RC_ARCHS)" \
--targets="$(TARGETS)" \
--prefix="$(PREFIX)" \
--symlinks=$(DO_SYMLINKS)
mkdir -p $(gcc_man1_dir)
install -c -m 444 man-pages/gcc3.1 $(gcc_man1_dir)/gcc3.1
ln -s gcc3.1 $(gcc_man1_dir)/g++3.1
ln -s gcc3.1 $(gcc_man1_dir)/c++3.1
install -c -m 444 man-pages/cpp3.1 $(gcc_man1_dir)/cpp3.1
install -c -m 444 man-pages/gcov3.1 $(gcc_man1_dir)/gcov3.1
installsrc: SRCROOT
@echo
@echo ++++++++++++++++++++++
@echo + Installing sources +
@echo ++++++++++++++++++++++
@echo
if [ $(SRCROOT) != . ]; then \
$(PAX) -rw . $(SRCROOT); \
fi
find -d "$(SRCROOT)" \( -type d -a -name CVS -o \
-type f -a -name .DS_Store \) \
-exec rm -rf {} \;
LIBSTDCPP_HDRS = cassert cctype cerrno cfloat ciso646 \
climits clocale cmath complex complex.h csetjmp \
csignal cstdarg cstddef cstdio cstdlib cstring ctime \
cwchar cwctype fstream iomanip iosfwd iostream \
stdexcept stl.h string strstream
LIBSTDCPP_STL_HDRS = algo.h algobase.h algorithm alloc.h bvector.h \
defalloc.h deque deque.h function.h functional hash_map hash_map.h \
hash_set hash_set.h hashtable.h heap.h iterator iterator.h list \
list.h map map.h memory multimap.h multiset.h numeric pair.h \
pthread_alloc pthread_alloc.h queue rope rope.h ropeimpl.h set \
set.h slist slist.h stack stack.h stl_algo.h stl_algobase.h \
stl_alloc.h stl_bvector.h stl_config.h stl_construct.h stl_deque.h \
stl_function.h stl_hash_fun.h stl_hash_map.h stl_hash_set.h \
stl_hashtable.h stl_heap.h stl_iterator.h stl_list.h stl_map.h \
stl_multimap.h stl_multiset.h stl_numeric.h stl_pair.h stl_queue.h \
stl_raw_storage_iter.h stl_relops.h stl_rope.h stl_set.h \
stl_slist.h stl_stack.h stl_tempbuf.h stl_tree.h \
stl_uninitialized.h stl_vector.h tempbuf.h tree.h type_traits.h \
utility vector vector.h
LIBSTDCPP_STD_HDRS = bastring.cc bastring.h complext.cc complext.h \
dcomplex.h fcomplex.h ldcomplex.h straits.h
LIBIO_HDRS = fstream.h iomanip.h iostream.h \
libio.h streambuf.h strfile.h strstream.h
LIBIO_OTHER_H = PlotFile.h SFile.h builtinbuf.h editbuf.h \
floatio.h indstream.h iolibio.h iostdio.h iostreamP.h \
istream.h libioP.h ostream.h parsestream.h pfstream.h \
procbuf.h stdiostream.h stream.h
cpp_hdr_dir=$(gcc_hdr_dir)/g++
cplusplus_hdrs: DSTROOT
mkdir -p $(cpp_hdr_dir)
for file in exception new new.h typeinfo; do \
install -c -m 444 gcc/cp/inc/$$file $(cpp_hdr_dir); \
done
for file in $(LIBSTDCPP_HDRS); do \
install -c -m 444 libstdc++/$$file $(cpp_hdr_dir); \
done
for file in $(LIBSTDCPP_STL_HDRS); do \
install -c -m 444 libstdc++/stl/$$file $(cpp_hdr_dir); \
done
for file in $(LIBSTDCPP_STD_HDRS); do \
install -c -m 444 libstdc++/std/$$file $(cpp_hdr_dir); \
done
for file in $(LIBIO_HDRS); do \
install -c -m 444 libio/$$file $(cpp_hdr_dir); \
done
install -c -m 444 _G_config.h $(cpp_hdr_dir)
cd $(cpp_hdr_dir) && rm -f std && ln -s . std
SYS_FRAMEWORK_DST = $(DSTROOT)/usr/local/lib/system
KEYMGR_OBJ = $(OBJROOT)/keymgr
KEYMGR_DEFINES = -DMACOSX -DPART_OF_SYSTEM_FRAMEWORK
CFLAGS = -I$(SRCROOT)/gcc/config/apple $(RC_CFLAGS) $(OTHER_CFLAGS) $(KEYMGR_DEFINES)
CC = $(DSTROOT)/usr/bin/cc -no-cpp-precomp
libkeymgr: $(KEYMGR_OBJ)/libkeymgr.a $(KEYMGR_OBJ)/libkeymgr_debug.a \
$(KEYMGR_OBJ)/libkeymgr_profile.a
install -d $(SYS_FRAMEWORK_DST)
install -c -m 444 $(KEYMGR_OBJ)/libkeymgr.a \
$(KEYMGR_OBJ)/libkeymgr_debug.a \
$(KEYMGR_OBJ)/libkeymgr_profile.a \
$(SYS_FRAMEWORK_DST)
$(KEYMGR_OBJ)/libkeymgr.a: keymgr.c $(SRCROOT)/gcc/config/apple/keymgr.h \
KEYMGR_OBJ
$(CC) $(CFLAGS) -O2 -c -o $(KEYMGR_OBJ)/keymgr.o keymgr.c
libtool -static -o $@ $(KEYMGR_OBJ)/keymgr.o
$(KEYMGR_OBJ)/libkeymgr_debug.a: keymgr.c $(SRCROOT)/gcc/config/apple/keymgr.h\
KEYMGR_OBJ
$(CC) $(CFLAGS) -g -c -o $(KEYMGR_OBJ)/keymgr.o keymgr.c
libtool -static -o $@ $(KEYMGR_OBJ)/keymgr.o
$(KEYMGR_OBJ)/libkeymgr_profile.a: keymgr.c \
$(SRCROOT)/gcc/config/apple/keymgr.h \
KEYMGR_OBJ
$(CC) $(CFLAGS) -pg -c -o $(KEYMGR_OBJ)/keymgr.o keymgr.c
libtool -static -o $@ $(KEYMGR_OBJ)/keymgr.o
clean:
@echo
@echo ++++++++++++
@echo + Cleaning +
@echo ++++++++++++
@echo
@if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
echo '*** DELETING ' $(OBJROOT); \
rm -rf $(OBJROOT); \
fi
@if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
echo '*** DELETING ' $(SYMROOT); \
rm -rf $(SYMROOT); \
fi
@if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
echo '*** DELETING ' $(DSTROOT); \
rm -rf $(DSTROOT); \
fi
OBJROOT SYMROOT DSTROOT KEYMGR_OBJ:
mkdir -p $($@)
SRCROOT:
@if [ -n "$($@)" ]; \
then \
exit 0; \
else \
echo Must define $@; \
exit 1; \
fi