.depend
obj-ack
obj-gnu
+obj-elf-base
tools/revision
TAGS
tags
@echo "Usage:"
@echo " make world # Compile everything (libraries & commands)"
@echo " make includes # Install include files from src/"
- @echo " make libraries # Compile and install libraries"
+ @echo " make libraries # Compile and install libraries (ack)"
+.ifdef MINIX_GENERATE_ELF
+ @echo " make elf-libraries # Compile and install gcc/clang elf libs"
+.endif
@echo " make commands # Compile all, commands, but don't install"
@echo " make install # Compile and install commands"
@echo " make depend # Generate required .depend files"
@echo " make gnu-includes # Install include files for GCC"
+.ifndef MINIX_GENERATE_ELF
@echo " make gnu-libraries # Compile and install libraries for GCC"
@echo " make clang-libraries # Compile and install libraries for GCC with clang"
+.endif
@echo " make clean # Remove all compiler results"
@echo ""
@echo "Run 'make' in tools/ to create a new MINIX configuration."
# 'make install' target.
#
# etcfiles has to be done first.
+.ifdef MINIX_GENERATE_ELF
+world: mkfiles includes depend libraries elf-libraries install etcforce
+.else
.if ${COMPILER_TYPE} == "ack"
world: mkfiles includes depend libraries install etcforce
.elif ${COMPILER_TYPE} == "gnu"
world: mkfiles elf-includes depend elf-libraries install etcforce
.endif
.endif
+.endif
mkfiles:
make -C share/mk install
SHELL=/bin/sh; if [ -f $(MKHEADERS443) ] ; then sh -e $(MKHEADERS443) ; fi
SHELL=/bin/sh; if [ -f $(MKHEADERS443_PKGSRC) ] ; then sh -e $(MKHEADERS443_PKGSRC) ; fi
+.ifndef MINIX_GENERATE_ELF
gnu-libraries: #gnu-includes
$(MAKE) -C lib build_gnu
clang-libraries: includes
$(MAKE) -C lib build_clang
+.endif
-MKHEADERS443_ELF=/usr/gnu_cross/libexec/gcc/i386-pc-minix3/4.4.3/install-tools/mkheaders
-elf-includes: includes
- cp -r /usr/include/* /usr/gnu_cross/i386-pc-minix3/sys-include
- SHELL=/bin/sh; if [ -f $(MKHEADERS443_ELF) ] ; then sh -e $(MKHEADERS443_ELF) ; fi
-
+.ifdef MINIX_GENERATE_ELF
+elf-libraries: includes
+ $(MAKE) -C lib build_elf_base
+.else
elf-libraries: elf-includes
$(MAKE) -C lib build_elf
+.endif
commands: includes libraries
$(MAKE) -C commands all
$(MAKE) -C boot clean
$(MAKE) -C commands clean
$(MAKE) -C tools clean
- $(MAKE) -C lib clean_gnu
- $(MAKE) -C lib clean_ack
- $(MAKE) -C lib clean_elf
- $(MAKE) -C lib clean_clang
+ $(MAKE) -C lib clean_all
$(MAKE) -C test clean
cleandepend:
else GNM=nm
fi
-ELFNM=/usr/gnu_cross/bin/i386-pc-minix3-nm
-
# Invoke gnu nm or ack nm?
if file $executable | grep NSYM >/dev/null 2>&1
then NM="$GNM --radix=d"
elif file $executable | grep ELF >/dev/null 2>&1
-then NM="$ELFNM --radix=d"
+then NM="$GNM --radix=d"
else NM="acknm -d"
fi
/* Minix release and version numbers. */
#define OS_RELEASE "3"
-#define OS_VERSION "1.9"
+#define OS_VERSION "2.0"
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains
+20110228:
+ (Next release bumped to MINIX 3.2.0.)
+ ELF support in the base system. /usr/lib libraries
+ will be in ELF format once you upgrade.
+ These were know as 'gcc format', but now more properly refered
+ to as 'elf format,' as they are shared between gcc and clang.
+ To start producing ELF, please see:
+ http://wiki.minix3.org/en/UsersGuide/ELFSwitch
+
20110225:
Create ddekit include dirs:
mkdir -p /usr/include/ddekit/minix
#include "debug.h"
/* Translate an endpoint number to a process number, return success. */
+#ifndef isokendpt
#define isokendpt(e,p) isokendpt_d((e),(p),0)
#define okendpt(e,p) isokendpt_d((e),(p),1)
+#endif
/* Constants used in virtual_copy(). Values must be 0 and 1, respectively. */
#define _SRC_ 0
build_ack:
sh ack_build.sh obj depend all install
+.if defined(MINIX_GENERATE_ELF)
+build_elf_base:
+ sh elf_build_base.sh obj depend all install
+.else
build_gnu:
sh gnu_build.sh obj depend all install
+.endif
-build_clang:
- sh clang_build.sh obj depend all install
-
-build_elf:
- sh elf_build.sh obj depend all install
-
-clean_ack:
+clean_all:
sh ack_build.sh clean
-
-clean_gnu:
+ sh clang_build.sh clean
sh gnu_build.sh clean
-
-clean_elf:
+ sh elf_build_base.sh clean
sh elf_build.sh clean
-
-clean_clang:
- sh clang_build.sh clean
#!/bin/sh
+set -e
+
export CC=cc
export MAKEOBJDIR=obj-ack
#!/bin/sh
+# This file is obsolete and is only useful to 'clean' its objects.
+
export CC=i386-pc-minix3-gcc
export COMPILER_TYPE=gnu
export MAKEOBJDIR=obj-elf
export PATH=$PATH:/usr/gnu_cross/bin
+if [ "$@" != clean ]
+then echo "$0: Unexpected arguments $@"
+ exit 1
+fi
+
make $@
--- /dev/null
+#!/bin/sh
+
+set -e
+
+export CC=clang
+export COMPILER_TYPE=gnu
+export MAKEOBJDIR=obj-elf-base
+export PATH=$PATH:/usr/pkg/bin
+
+make $@
INFOOWN?= root
INFOMODE?= ${NONBINMODE}
-#LIBDIR?= /usr/lib
+LIBDIR?= /usr/lib
.if ${COMPILER_TYPE} == "ack"
LIBDIR?= /usr/lib/i386
.endif
# All platforms are ELF.
#
#OBJECT_FMT= ELF
-.if !empty(CC:Mi386-pc-minix3-gcc) || !empty(CC:Mclang)
+.if defined(MINIX_GENERATE_ELF) && ${COMPILER_TYPE} == "gnu"
OBJECT_FMT= ELF
.else
OBJECT_FMT= a.out
.endif
+
.if ${COMPILER_TYPE} == "gnu"
.if defined(NBSD_LIBC) && (${NBSD_LIBC} != "no")
LIBDIR?= /usr/netbsd/lib
.endif
-.if ${OBJECT_FMT} == "a.out"
-LIBDIR?= /usr/lib
-.elif ${OBJECT_FMT} == "ELF"
-LIBDIR?= /usr/gnu_cross/i386-pc-minix3/lib
-.endif
.endif
#
# in a traditional environment' warning, as opposed to 'this code behaves
# differently in traditional and ansi environments' which is the warning
# we wanted, and now we don't get anymore.
-CFLAGS+= -Wno-sign-compare -Wno-traditional
-.if !defined(NOGCCERROR)
+CFLAGS+= -Wno-sign-compare
+.if !empty(CC:Mgcc)
+CFLAGS+= -Wno-traditional
+.endif
+.if !defined(NOGCCERROR) && !empty(CC:Mgcc)
# Set assembler warnings to be fatal
CFLAGS+= -Wa,--fatal-warnings
.endif
# XXX no proper way to avoid "FOO is a patented algorithm" warnings
# XXX on linking static libs
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
- (!defined(LDSTATIC) || ${LDSTATIC} != "-static")
+ (!defined(LDSTATIC) || ${LDSTATIC} != "-static") \
+ && !empty(CC:Mgcc)
LDFLAGS+= -Wl,--fatal-warnings
.endif
.endif
# chmod a+x ${.TARGET}
# MINIX
+
.if !empty(CC:Mcc)
COMPILER_TYPE=ack
-.elif !empty(CC:Mgcc)
+.elif !empty(CC:Mgcc) || !empty(CC:Mclang)
COMPILER_TYPE=gnu
AR=ar
-.elif !empty(CC:Mi386-pc-minix3-gcc) || !empty(CC:Mclang)
-COMPILER_TYPE=gnu
-AR=i386-pc-minix3-ar
-LD=i386-pc-minix3-ld
-OBJCOPY=i386-pc-minix3-objcopy
+.endif
+
+.if exists(/usr/pkg/i386-pc-minix/lib/ldscripts/elf_i386_minix.x) \
+ && exists(/usr/pkg/lib/clang/2.9)
+MINIX_GENERATE_ELF=yes
.endif
# Set NBSD_LIBC to either "yes" or "no".
exit $?
fi
-make NOASSERTS=yes world
+make world
cd tools
rm revision
rm /boot/image/*
export SHELL=/bin/sh
PKG_ADD=/usr/pkg/sbin/pkg_add
+PKG_INFO=/usr/pkg/sbin/pkg_info
if [ ! -x $PKG_ADD ]
then echo Please install pkg_install from pkgsrc.
fi
# Packages we have to pre-install, and url to use
-PREINSTALLED_PACKAGES="pkgin-0.3.3.4.tgz pkg_install-20101212 bmake-20100808"
PACKAGEURL=ftp://ftp.minix3.org/pub/minix/packages/$version_pretty/`uname -m`/All/
+PREINSTALLED_PACKAGES="
+ pkgin-0.4.1
+ pkg_install-20101212
+ bmake-20100808
+ binutils-2.17nb3
+ clang-2.9nb2
+ compiler-rt-r123836nb3
+ "
+
+PKG_ADD_URL=$PACKAGEURL
RELEASERC=$HOME/.releaserc
FILENAMEOUT=""
-while getopts "s:pmMchu?r:f:" c
+while getopts "ls:pmMchu?r:f:" c
do
case "$c" in
\?)
- echo "Usage: $0 [-p] [-c] [-h] [-m] [-M] [-r <tag>] [-u] [-f <filename>] [-s <username>]" >&2
+ echo "Usage: $0 [-l] [-p] [-c] [-h] [-m] [-M] [-r <tag>] [-u] [-f <filename>] [-s <username>]" >&2
exit 1
;;
h)
;;
M) MAKEMAP=1
;;
+ l) PKG_ADD_URL=file://$PACKAGEDIR
+ ;;
esac
done
echo "Copying contents from current src dir."
( cd .. && make depend && make clean )
srcdir=/usr/$SRC
- ( cd $srcdir && tar cf - . ) | ( cd $RELEASEDIR/usr && mkdir $SRC && cd $SRC && tar xf - )
+ ( cd $srcdir && tar --exclude .svn -cf - . ) | ( cd $RELEASEDIR/usr && mkdir $SRC && cd $SRC && tar xf - )
REVTAG=copy
REVISION=unknown
IMG=${IMG_BASE}_copy.iso
chroot $RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh etcfiles" || exit 1
for p in $PREINSTALLED_PACKAGES
-do echo " * Pre-installing: $p from $PACKAGEURL"
- $PKG_ADD -P $RELEASEDIR $PACKAGEURL/$p
+do echo " * Pre-installing: $p from $PKG_ADD_URL"
+ $PKG_ADD -P $RELEASEDIR $PKG_ADD_URL/$p
done
echo " * Chroot build"