Build the Haiku version with a makefile

This commit is contained in:
George Sokianos 2023-01-29 17:55:21 +00:00
parent 04deddbe79
commit abfd7f5876
2 changed files with 102 additions and 1 deletions

99
Makefile.haiku Normal file
View File

@ -0,0 +1,99 @@
#
# Project: Lite XL
#
# Created on: 26-12-2021
#
LiteXL_OBJ := \
src/main.o src/rencache.o src/renderer.o src/renwindow.o \
src/api/api.o src/api/dirmonitor.o \
src/api/regex.o src/api/renderer.o src/api/system.o \
src/api/utf8.o src/api/dirmonitor/dummy.o src/api/process.o
outfile := lite-xl
compiler := gcc
cxxcompiler := g++
INCPATH := -Isrc -Ilib/dmon -I/boot/system/develop/headers/SDL2 \
-I/boot/system/develop/headers/lua54 -I/boot/home/development/freetype-2.12.1/include
DFLAGS += -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR
CFLAGS += -Werror -Wwrite-strings -O2 -g -std=gnu11 -fno-strict-aliasing
LFLAGS += -L/boot/home/development/freetype-2.12.1/objs/.libs \
-lpcre2-8 -lSDL2 -llua -lfreetype -lz -lm -lpthread
ifeq ($(DEBUG),1)
CFLAGS += -gstabs
LFLAGS += -gstabs
ifeq ($(PROFYLER),1)
CFLAGS += -finstrument-functions -fno-inline -DPROFILING
LFLAGS += -lprofyle
endif
endif
.PHONY: LiteXL clean release
default: LiteXL
clean:
@echo "Cleaning compiler objects..."
@rm -f $(LiteXL_OBJ)
LiteXL: $(LiteXL_OBJ)
@echo "Linking LiteXL"
@$(compiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS)
.c.o:
@echo "Compiling $<"
@$(compiler) -c $< -o $*.o $(CFLAGS) $(INCPATH) $(DFLAGS)
src/main.o: src/main.c src/api/api.h src/rencache.h \
src/renderer.h
src/rencache.o: src/rencache.c
src/renderer.o: src/renderer.c
src/renwindow.o: src/renwindow.c
src/api/api.o: src/api/api.c
src/api/regex.o: src/api/regex.c
src/api/renderer.o: src/api/renderer.c
src/api/system.o: src/api/system.c
src/api/dirmonitor.o: src/api/dirmonitor.c src/api/dirmonitor/dummy.c
src/api/utf8.o: src/api/utf8.c
src/api/dirmonitor/dummy.o: src/api/dirmonitor/dummy.c
src/api/process.o: src/api/process.c
release:
@echo "Creating release files..."
@mkdir -p release/LiteXL2
@cp -r release_files/* release/LiteXL2/
@mv release/LiteXL2/LiteXL2.info release/
@cp -r data release/LiteXL2/
@cp changelog.md release/LiteXL2/
@cp $(outfile) release/LiteXL2/
@strip release/LiteXL2/$(outfile)
@cp README.md release/LiteXL2/
@cp README_Amiga.md release/LiteXL2/
@cp LICENSE release/LiteXL2/
@echo "Creating release archive..."
@lha -aeqr3 a LiteXL2_OS4.lha release/
@echo "Clean release files..."
@delete release ALL QUIET FORCE

View File

@ -9,7 +9,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#elif defined(__linux__) #elif defined(__linux__) || defined(__HAIKU__)
#include <unistd.h> #include <unistd.h>
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
@ -110,6 +110,8 @@ void set_macos_bundle_resources(lua_State *L);
#define ARCH_PLATFORM "freebsd" #define ARCH_PLATFORM "freebsd"
#elif __APPLE__ #elif __APPLE__
#define ARCH_PLATFORM "darwin" #define ARCH_PLATFORM "darwin"
#elif __HAIKU__
#define ARCH_PLATFORM "haiku"
#endif #endif
#if !defined(ARCH_PROCESSOR) || !defined(ARCH_PLATFORM) #if !defined(ARCH_PROCESSOR) || !defined(ARCH_PLATFORM)