Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The makefile will perform a check to ensure that a cross compiler exi… #156

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions GNUmakefile.os4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
UNAME := $(shell uname)

INSTALL_PREFIX ?= /usr/ppc-amigaos/SDK/clib4
SDK_INCLUDE ?= /usr/ppc-amigaos/SDK/include

CC := ppc-amigaos-gcc
AR := ppc-amigaos-ar -q
Expand All @@ -34,6 +33,18 @@ STRIP := ppc-amigaos-strip
RANLIB := ppc-amigaos-ranlib
HOST_CXX := g++

# Check that there is the required cross compiler on the path
CC_LOC=$(shell which $(CC))
ifeq ($(CC_LOC),)
$(error Required cross compiler not found. Expected 'ppc-amigaos-gcc' to be found on the PATH)
else
# The only header files we need are the SDK ones
SDK_INCLUDE ?= $(addsuffix ../ppc-amigaos/SDK/include/include_h/,$(dir $(CC_LOC)))
ifeq ($(realpath $(SDK_INCLUDE)),)
$(error Required AmigaOS SDK files not found. Expected directory '$(SDK_INCLUDE)' to exist)
endif
endif

# On AmigaOS use native commands
ifeq ($(UNAME), AmigaOS)
COPY := copy
Expand Down Expand Up @@ -101,7 +112,8 @@ SHARED := $(if $(SHARED),$(SHARED),yes)
STATIC := $(if $(STATIC),$(STATIC),yes)

LARGEDATA :=
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -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 -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU -pipe \
-nostdinc -nostartfiles -nostdlib
OPTIMIZE := -O3 -mregnames -mmultiple -mupdate -ffp-contract=fast -mstrict-align

STABS :=
Expand Down Expand Up @@ -211,7 +223,7 @@ version:
# Shared clib4.library rules

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

clib4.library: clib4.library.debug
cp $(BUILD_DIR)/$< $(BUILD_DIR)/$@
Expand Down
Loading