Skip to content

Commit

Permalink
Moved libprofile into libc
Browse files Browse the repository at this point in the history
  • Loading branch information
afxgroup committed Sep 17, 2023
2 parents d362aac + 3250444 commit 8369bb4
Show file tree
Hide file tree
Showing 32 changed files with 1,493 additions and 148 deletions.
33 changes: 13 additions & 20 deletions GNUmakefile.os4
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ AR := ppc-amigaos-ar -q
LD := ppc-amigaos-ld
RANLIB := ppc-amigaos-ranlib
STRIP := ppc-amigaos-strip
RANLIB := ppc-amigaos-ranlib
HOST_CXX := g++

# On AmigaOS use native commands
Expand Down Expand Up @@ -100,13 +101,11 @@ SHARED := $(if $(SHARED),$(SHARED),yes)
STATIC := $(if $(STATIC),$(STATIC),yes)

LARGEDATA :=
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__CLIB2__ -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU -pipe
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__CLIB2__ -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU -pipe -Ttext=0x00000000
OPTIMIZE := -O3 -mregnames -mmultiple -mupdate -mstrict-align
PROFILE_P :=

STABS :=
DLIBS :=
PLIBS :=

ifndef DEBUG
OPTIMIZE += $(STABS) -DNDEBUG
Expand All @@ -115,14 +114,9 @@ else
DLIBS += $(BUILD_DIR)/lib/libdebug.a
endif

ifdef PROFILE
PROFILE_P := -pg -Ttext=0x00000000
PLIBS += $(BUILD_DIR)/lib/libprofile.a $(BUILD_DIR)/lib/libm.a
endif

CFLAGS := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES) $(PROFILE_P) -D__USE_INLINE__
CFLAGS_N := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES) $(PROFILE_P)
AFLAGS := -Wa,-mregnames -mstrict-align $(PROFILE_P)
CFLAGS := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES) -D__USE_INLINE__
CFLAGS_N := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES)
AFLAGS := -Wa,-mregnames -mstrict-align -Ttext=0x00000000

ifdef SPE
CC := ppc-amigaos-gcc-6.4.0
Expand Down Expand Up @@ -155,7 +149,6 @@ include libc.gmk
include libm.gmk
include libamiga.gmk
include libdebug.gmk
include libprofile.gmk
include libpthread.gmk
include libcrypt.gmk
include librt.gmk
Expand Down Expand Up @@ -206,21 +199,19 @@ clean:
# Update the version numbers bound to the individual libraries
version:
$(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev
$(COPY) c.lib_rev.rev profile/profile.lib_rev.rev
$(COPY) c.lib_rev.rev math/m.lib_rev.rev
$(COPY) c.lib_rev.rev math/crypt.lib_rev.rev
$(COPY) c.lib_rev.rev math/pthread.lib_rev.rev
bumprev amiga.lib
bumprev c.lib
bumprev profile.lib
bumprev m.lib
bumprev crypt.lib
bumprev pthread.lib

# Shared clib2.library rules

clib2.library.debug: $(OBJ_C_LIB)
$(VERBOSE)$(CC) -o $(BUILD_DIR)/$@ $(CFLAGS) $(BUILD_DIR)/shared/shared_library/clib2.o $(BUILD_DIR)/shared/shared_library/math.o $(OBJ_C_LIB) $(DLIBS) $(PLIBS) -Wl,--cref,-M,-Map=$(BUILD_DIR)/$@.map -nostartfiles -nostdlib
$(VERBOSE)$(CC) -o $(BUILD_DIR)/$@ $(CFLAGS) $(BUILD_DIR)/shared/shared_library/clib2.o $(BUILD_DIR)/shared/shared_library/math.o $(OBJ_C_LIB) $(BUILD_DIR)/lib/libc.a $(DLIBS) -Wl,--cref,-M,-Map=$(BUILD_DIR)/$@.map -nostartfiles -nostdlib

clib2.library: clib2.library.debug
cp $(BUILD_DIR)/$< $(BUILD_DIR)/$@
Expand Down Expand Up @@ -364,8 +355,10 @@ compile-tests:
install:
$(DELETE) $(INSTALL_PREFIX)/include/*
$(DELETE) $(INSTALL_PREFIX)/lib/*
$(DELETE) $(INSTALL_PREFIX)/clib2.library*
$(COPY) $(OUTPUT_LIB)/* $(INSTALL_PREFIX)/lib/
$(COPY) libs/libauto.a $(INSTALL_PREFIX)/lib/
$(COPY) $(BUILD_DIR)/clib2.library* $(INSTALL_PREFIX)
$(COPY) $(LIB_ROOT)/library/include/* $(INSTALL_PREFIX)/include/

release:
Expand All @@ -390,11 +383,11 @@ release:
dpkg:
-$(DELETE) $(DPKG_LIB)
-$(DELETE) $(DPKG_LIB).deb
-$(MAKEDIR) $(DPKG_LIB)/usr/ppc-amigaos/SDK/clib2/lib
-$(MAKEDIR) $(DPKG_LIB)/usr/ppc-amigaos/SDK/clib2/include
-$(MAKEDIR) $(DPKG_LIB)$(INSTALL_PREFIX)/lib
-$(MAKEDIR) $(DPKG_LIB)$(INSTALL_PREFIX)/include
-$(MAKEDIR) $(DPKG_LIB)/DEBIAN
-$(COPY) libs/libauto.a $(DPKG_LIB)/usr/ppc-amigaos/SDK/clib2/lib/
-$(COPY) $(OUTPUT_LIB)/* $(DPKG_LIB)/usr/ppc-amigaos/SDK/clib2/lib/
-$(COPY) $(LIB_ROOT)/library/include/* $(DPKG_LIB)/usr/ppc-amigaos/SDK/clib2/include/
-$(COPY) libs/libauto.a $(DPKG_LIB)$(INSTALL_PREFIX)/lib/
-$(COPY) $(OUTPUT_LIB)/* $(DPKG_LIB)$(INSTALL_PREFIX)/lib/
-$(COPY) $(LIB_ROOT)/library/include/* $(DPKG_LIB)$(INSTALL_PREFIX)/include/
-$(COPY) misc/control $(DPKG_LIB)/DEBIAN/
dpkg --build $(DPKG_LIB)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C runtime library for AmigaOS4
runtime library for AmigaOS4

[![Build Status](https://travis-ci.com/afxgroup/clib2.svg?branch=master)](https://travis-ci.org/afxgroup/clib2)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
Expand Down
13 changes: 13 additions & 0 deletions libc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ C_ENVZ := \
envz/envz_remove.o \
envz/envz_strip.o

C_FTS := \
fts/fts.o

C_ICONV := \
iconv/iconv.o \
iconv/iconv_close.o \
Expand Down Expand Up @@ -925,6 +928,7 @@ C_LIBRARY := \
$(C_DIRENT) \
$(C_DEBUG) \
$(C_ENVZ) \
$(C_FTS) \
$(C_ICONV) \
$(C_INTTYPES) \
$(C_LOCALE) \
Expand All @@ -950,6 +954,10 @@ C_LIBRARY := \

C_LIB := \
c.lib_rev.o \
profile/_mcount.o \
profile/profil.o \
profile/gmon.o \
profile/mcount.o \
shared_library/stubs.o \
unistd/getopt.o \
unistd/getopt_long.o
Expand Down Expand Up @@ -982,6 +990,11 @@ $(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED)
endif

$(OUT_STATIC)/profile/%.o : $(LIB_DIR)/profile/%.S
$(VERBOSE)$(COMPILE_REG)
$(OUT_SHARED)/profile/%.o : $(LIB_DIR)/profile/%.S
$(VERBOSE)$(COMPILE_REG)

$(OUTPUT_LIB)/libc.a : $(SOURCES_STATIC)
$(VERBOSE)@$(MAKELIB)
$(OUTPUT_LIB)/libc.so : $(SOURCES_SHARED)
Expand Down
57 changes: 0 additions & 57 deletions libprofile.gmk

This file was deleted.

Loading

0 comments on commit 8369bb4

Please sign in to comment.