Changes to compile and create a release of the library
This commit is contained in:
parent
2d606701e8
commit
8e9ca315f2
|
@ -16,3 +16,6 @@ scripts/opjstyle*
|
|||
|
||||
# Ignore directories made by `make`.
|
||||
/bin/
|
||||
build
|
||||
SDK
|
||||
*.lha
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
USE_CLIB2=YES
|
||||
ifeq ($(USE_CLIB2), YES)
|
||||
LIBC=clib2
|
||||
CODEC=OFF
|
||||
else
|
||||
LIBC=newlib
|
||||
CODEC=ON
|
||||
endif
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CROSSCOMPILING=ON \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(realpath amigaos4.cmake) \
|
||||
-DCMAKE_C_FLAGS="-mcrt=${LIBC} -O2 -fPIC" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS="-mcrt=${LIBC} -lpthread -athread=native" \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DBUILD_CODEC=${CODEC} \
|
||||
-DBUILD_SHARED_LIBS=OFF && \
|
||||
make
|
||||
|
||||
clean:
|
||||
@echo "Clean the build"
|
||||
@rm -rf build
|
||||
|
||||
cleanall: clean
|
||||
@echo "Clean the build and the release files"
|
||||
@rm -rf SDK
|
||||
@rm libopenjpeg.lha
|
||||
|
||||
release:
|
||||
@echo "Create release folders..."
|
||||
@mkdir -p SDK/local/common/include
|
||||
@mkdir -p SDK/local/clib2/lib
|
||||
@mkdir -p SDK/local/newlib/lib SDK/local/newlib/bin
|
||||
|
||||
@echo "Building clib2 based libraries..."
|
||||
@make -f Makefile.os4 USE_CLIB2=YES
|
||||
@cp ./build/bin/libopenjp2.a SDK/local/clib2/lib/
|
||||
@cp ./src/lib/openjp2/openjpeg.h SDK/local/common/include/
|
||||
|
||||
@echo "Clean build and libraries files..."
|
||||
@make -f Makefile.os4 clean
|
||||
|
||||
@echo "Building newlib based libraries..."
|
||||
@make -f Makefile.os4 USE_CLIB2=NO
|
||||
@cp ./build/bin/libopenjp2.a SDK/local/newlib/lib/
|
||||
@cp ./build/bin/opj_* SDK/local/newlib/bin/
|
||||
|
||||
@echo "Creating the lha release file..."
|
||||
@lha -aeq libopenjpeg.lha SDK/
|
|
@ -0,0 +1,9 @@
|
|||
SET(CMAKE_SYSTEM_NAME Generic)
|
||||
SET(CMAKE_SYSTEM_PROCESSOR ppc)
|
||||
SET(CMAKE_C_COMPILER /opt/ppc-amigaos/bin/ppc-amigaos-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /opt/ppc-amigaos/bin/ppc-amigaos-g++)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES "*.a")
|
||||
SET(CMAKE_FIND_ROOT_PATH /opt/sdk)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -44,7 +44,11 @@
|
|||
Standard includes used by the library
|
||||
==========================================================
|
||||
*/
|
||||
#if defined(__amigaos4__)
|
||||
#include <exec/memory.h>
|
||||
#else
|
||||
#include <memory.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
|
Loading…
Reference in New Issue