You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
55 lines
1.3 KiB
|
|
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/
|