minix/Makefile
Gianluca Guida cc17b27a2b Build NetBSD libc library in world in ELF mode.
3 sets of libraries are built now:
  . ack: all libraries that ack can compile (/usr/lib/i386/)
  . clang+elf: all libraries with minix headers (/usr/lib/)
  . clang+elf: all libraries with netbsd headers (/usr/netbsd/)

Once everything can be compiled with netbsd libraries and headers, the
/usr/netbsd hierarchy will be obsolete and its libraries compiled with
netbsd headers will be installed in /usr/lib, and its headers
in /usr/include. (i.e. minix libc and current minix headers set
will be gone.)

To use the NetBSD libc system (libraries + headers) before
it is the default libc, see:
   http://wiki.minix3.org/en/DevelopersGuide/UsingNetBSDCode
This wiki page also documents the maintenance of the patch
files of minix-specific changes to imported NetBSD code.

Changes in this commit:
  . libsys: Add NBSD compilation and create a safe NBSD-based libc.
  . Port rest of libraries (except libddekit) to new header system.
  . Enable compilation of libddekit with new headers.
  . Enable kernel compilation with new headers.
  . Enable drivers compilation with new headers.
  . Port legacy commands to new headers and libc.
  . Port servers to new headers.
  . Add <sys/sigcontext.h> in compat library.
  . Remove dependency file in tree.
  . Enable compilation of common/lib/libc/atomic in libsys
  . Do not generate RCSID strings in libc.
  . Temporarily disable zoneinfo as they are incompatible with NetBSD format
  . obj-nbsd for .gitignore
  . Procfs: use only integer arithmetic. (Antoine Leca)
  . Increase ramdisk size to create NBSD-based images.
  . Remove INCSYMLINKS handling hack.
  . Add nbsd_include/sys/exec_elf.h
  . Enable ELF compilation with NBSD libc.
  . Add 'make nbsdsrc' in tools to download reference NetBSD sources.
  . Automate minix-port.patch creation.
  . Avoid using fstavfs() as it is *extremely* slow and unneeded.
  . Set err() as PRIVATE to avoid name clash with libc.
  . [NBSD] servers/vm: remove compilation warnings.
  . u32 is not a long in NBSD headers.
  . UPDATING info on netbsd hierarchy
  . commands fixes for netbsd libc
2011-06-24 11:46:30 +02:00

128 lines
3.7 KiB
Makefile

# Master Makefile to compile everything in /usr/src except the system.
.include <bsd.own.mk>
MAKE=make
usage:
@echo ""
@echo "Master Makefile for MINIX commands and utilities."
@echo "Root privileges are required for some actions."
@echo ""
@echo "Usage:"
@echo " make world # Compile everything (libraries & commands)"
@echo " make includes # Install include files from src/"
@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."
@echo ""
# world has to be able to make a new system, even if there
# is no complete old system. it has to install commands, for which
# it has to install libraries, for which it has to install includes,
# for which it has to install /etc (for users and ownerships).
# etcfiles also creates a directory hierarchy in its
# '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"
.if ${OBJECT_FMT} == "a.out"
world: mkfiles includes depend gnu-libraries install etcforce
.elif ${OBJECT_FMT} == "ELF"
world: mkfiles elf-includes depend elf-libraries install etcforce
.endif
.endif
.endif
mkfiles:
make -C share/mk install
includes:
$(MAKE) -C nbsd_include includes
$(MAKE) -C include includes
$(MAKE) -C lib includes NBSD_LIBC=yes
$(MAKE) -C lib includes NBSD_LIBC=no
libraries: includes
$(MAKE) -C lib build_ack
MKHEADERS411=/usr/gnu/libexec/gcc/i386-pc-minix/4.1.1/install-tools/mkheaders
MKHEADERS443=/usr/gnu/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders
MKHEADERS443_PKGSRC=/usr/pkg/gcc44/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders
gnu-includes: includes
SHELL=/bin/sh; if [ -f $(MKHEADERS411) ] ; then sh -e $(MKHEADERS411) ; fi
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: includes #gnu-includes
$(MAKE) -C lib build_gnu
clang-libraries: includes
$(MAKE) -C lib build_clang
.endif
.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
depend:
$(MAKE) CC=cc -C boot depend
$(MAKE) -C commands depend
$(MAKE) -C kernel depend
$(MAKE) -C servers depend
$(MAKE) -C drivers depend
etcfiles:
$(MAKE) -C etc install
etcforce:
$(MAKE) -C etc installforce
all:
$(MAKE) CC=cc -C boot all
$(MAKE) -C commands all
$(MAKE) -C tools all
install:
$(MAKE) CC=cc -C boot install
$(MAKE) -C man install makedb
$(MAKE) -C commands install
$(MAKE) -C share install
$(MAKE) -C tools install
clean:
$(MAKE) -C boot clean
$(MAKE) -C commands clean
$(MAKE) -C tools clean
$(MAKE) -C lib clean_all
$(MAKE) -C test clean
cleandepend:
$(MAKE) -C boot cleandepend
$(MAKE) -C commands cleandepend
$(MAKE) -C tools cleandepend