1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00
Files
amiga-clib2/library/GNUmakefile.os4
Olaf Barthel e789564429 - readlink() no longer sort-of-works for files and directories. It now only
works for soft linked objects and returns an error for everything else.
  This is based upon a fix by Peter Bengtsson. Thank you very much!

- Moved the lstat() local Lock() function into its own separate file.

- uname() now returns correct and robust information for OS version
  numbers > 36. This integrates a fix by Peter Bengtsson. Thank you
  very much!

- Moved the crtbegin.o/crtend.o files out of the link libraries. Moving
  them in was intended to work as a fix for the shared library build, but
  now it seems that this has to be done at the link stage through the
  GCC specs file...

- Integrated a fix for __rem_pio2() which affects sin(), tan() and cos(),
  contributed by Steven Solie. Thank you very much!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15161 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2006-11-13 09:25:28 +00:00

233 lines
5.9 KiB
Plaintext

#
# $Id: GNUmakefile.os4,v 1.110 2006-11-13 09:25:28 obarthel Exp $
#
# :ts=8
#
# -*- mode: makefile; -*-
##############################################################################
.PHONY : all all-targets clean version cvs-tag
# You may have to change the following sets of macro definitions which will
# be used throughout the build makefile. These definitions cover the paths
# to look into for the operating system and networking header files, and
# the names and parameters passed to the program which actually do the
# compilation, library building and cleanup work.
#
# Note that for either set you still need the GNU make utility to build the
# library!
# These are for the cross compiler, with the operating system header files
# stored in "/V/include" and the network header files in a local directory
# called "netinclude".
#SDK_INCLUDE := /V/include
#NET_INCLUDE := netinclude
#CC := ppc-amigaos-gcc
#AR := ppc-amigaos-ar -q
#RANLIB := ppc-amigaos-ranlib
#COPY := cp -a
#DELETE := rm -rf
#MAKEDIR := mkdir -p
#LOG_COMMAND := 2>&1 | tee -a compiler.log
# The following are for the native OS4 compiler; note that the
# LOG_COMMAND should not be enabled unless you have a shell
# installed which supports it.
SDK_INCLUDE := /SDK/Include/include_h
NET_INCLUDE := /SDK/Include/netinclude
CC := distcc gcc
AR := ar -q
RANLIB := ranlib
COPY := copy
DELETE := delete all quiet force
MAKEDIR := makedir all force
LOG_COMMAND := *>< | tee >>compiler.log
##############################################################################
WARNINGS := \
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused -Wwrite-strings
# -Wconversion -Wshadow
INCLUDES := -Iinclude -I. -I$(SDK_INCLUDE)
OPTIONS := -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames -fno-common -std=gnu99
OPTIMIZE := -DNDEBUG -O3
#DEBUG := -ggdb
#MEMDEBUG := -D__USE_MEM_TREES -D__MEM_DEBUG
CFLAGS := $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(MEMDEBUG) $(OPTIONS) $(INCLUDES)
AFLAGS := -Wa,-mregnames
LARGEDATA := -msdata=data
SOFTFLOAT := -msdata=data -msoft-float
SMALLDATA := -msdata=sysv -DSMALL_DATA
BASEREL := -mbaserel -DBASEREL_DATA
THREADSAFE := -D__THREAD_SAFE
##############################################################################
# This is the first target: it depends on all the targets
all: all-targets
##############################################################################
# The LIBS variable is updated by each of the included library makefiles.
LIBS :=
include libc.gmk
include libunix.gmk
include libm.gmk
include libnet.gmk
include libdebug.gmk
include libamiga.gmk
include libprofile.gmk
all-targets: \
lib/crt0.o \
lib/small-data/crt0.o \
lib/soft-float/crt0.o \
lib/baserel/crt0.o \
lib/crtbegin.o \
lib/soft-float/crtbegin.o \
lib/small-data/crtbegin.o \
lib/baserel/crtbegin.o \
lib/crtend.o \
lib/soft-float/crtend.o \
lib/small-data/crtend.o \
lib/baserel/crtend.o \
lib.threadsafe/crt0.o \
lib.threadsafe/small-data/crt0.o \
lib.threadsafe/soft-float/crt0.o \
lib.threadsafe/baserel/crt0.o \
lib.threadsafe/crtbegin.o \
lib.threadsafe/soft-float/crtbegin.o \
lib.threadsafe/small-data/crtbegin.o \
lib.threadsafe/baserel/crtbegin.o \
lib.threadsafe/crtend.o \
lib.threadsafe/soft-float/crtend.o \
lib.threadsafe/small-data/crtend.o \
lib.threadsafe/baserel/crtend.o \
$(LIBS)
##############################################################################
# Delete all object files and libraries
clean:
-$(DELETE) obj
-$(DELETE) obj.threadsafe
-$(DELETE) lib
-$(DELETE) lib.threadsafe
-$(DELETE) compiler.log
##############################################################################
# Update the version numbers bound to the individual libraries
version:
$(COPY) c.lib_rev.rev amiga.lib_rev.rev
$(COPY) c.lib_rev.rev debug.lib_rev.rev
$(COPY) c.lib_rev.rev m.lib_rev.rev
$(COPY) c.lib_rev.rev net.lib_rev.rev
$(COPY) c.lib_rev.rev unix.lib_rev.rev
$(COPY) c.lib_rev.rev profile.lib_rev.rev
bumprev 1 amiga.lib
bumprev 1 c.lib
bumprev 1 debug.lib
bumprev 1 m.lib
bumprev 1 net.lib
bumprev 1 unix.lib
bumprev 1 profile.lib
##############################################################################
# Tag all files with a certain version number
cvs-tag:
cvs -q tag V1_`cat c.lib_rev.rev`
##############################################################################
# General build rules for all object files and the individual libraries
lib/%.o : AFLAGS += $(LARGEDATA)
lib/%.o : %.S
@$(ASSEMBLE)
lib/%.o : %.c
@$(COMPILE)
lib/small-data/%.o : AFLAGS += $(SMALLDATA)
lib/small-data/%.o : %.S
@$(ASSEMBLE)
lib/small-data/%.o : %.c
@$(COMPILE)
lib/soft-float/%.o : AFLAGS += $(SOFTFLOAT)
lib/soft-float/%.o : %.S
@$(ASSEMBLE)
lib/soft-float/%.o : %.c
@$(COMPILE)
lib/baserel/%.o : AFLAGS += $(BASEREL)
lib/baserel/%.o : %.S
@$(ASSEMBLE)
lib/baserel/%.o : %.c
@$(COMPILE)
lib.threadsafe/%.o : AFLAGS += $(LARGEDATA) $(THREADSAFE)
lib.threadsafe/%.o : %.S
@$(ASSEMBLE)
lib.threadsafe/%.o : %.c
@$(COMPILE)
lib.threadsafe/small-data/%.o : AFLAGS += $(SMALLDATA) $(THREADSAFE)
lib.threadsafe/small-data/%.o : %.S
@$(ASSEMBLE)
lib.threadsafe/small-data/%.o : %.c
@$(COMPILE)
lib.threadsafe/soft-float/%.o : AFLAGS += $(SOFTFLOAT) $(THREADSAFE)
lib.threadsafe/soft-float/%.o : %.S
@$(ASSEMBLE)
lib.threadsafe/soft-float/%.o : %.c
@$(COMPILE)
lib.threadsafe/baserel/%.o : AFLAGS += $(BASEREL) $(THREADSAFE)
lib.threadsafe/baserel/%.o : %.S
@$(ASSEMBLE)
lib.threadsafe/baserel/%.o : %.c
@$(COMPILE)
##############################################################################
define COMPILE
$(MAKEDIR) $(@D)
echo "Compiling $< [$(@D)]"
$(CC) -o $@ -c $(CFLAGS) $< $(LOG_COMMAND)
endef
define ASSEMBLE
$(MAKEDIR) $(@D)
echo "Assembling $< [$(@D)]"
$(CC) -o $@ -c $(AFLAGS) $< $(LOG_COMMAND)
endef
define MAKELIB
$(MAKEDIR) $@
$(DELETE) $@
echo "Making $@"
$(AR) $@ $^ $(LOG_COMMAND)
$(RANLIB) $@ $(LOG_COMMAND)
endef