First changes and new makefile to have it compile on OS4

This commit is contained in:
George Sokianos 2021-12-14 22:09:51 +00:00
parent 38bd9b3326
commit 3a5cadc116
7 changed files with 163 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
src/*.o
src/*/*.o
src/*/*/*.o
lite
*.txt

103
Makefile Executable file
View File

@ -0,0 +1,103 @@
#
# Makefile generated by:
# codebench 0.55
#
# Project: lite
#
# Created on: 14-12-2021 20:40:46
#
#
###################################################################
##
##//// Objects
##
###################################################################
lite_OBJ := \
src/lib/stb/stb_truetype.o src/api/renderer.o src/api/renderer_font.o \
src/api/system.o src/main.o src/api/api.o \
src/rencache.o src/renderer.o
###################################################################
##
##//// Variables and Environment
##
###################################################################
CC := gcc:bin/gcc
INCPATH := -I.
CFLAGS := $(INCPATH) -D__USE_INLINE__ -Wall -Werror -Wwrite-strings -Isrc
###################################################################
##
##//// General rules
##
###################################################################
.PHONY: all all-before all-after clean clean-custom realclean
all: all-before lite all-after
all-before:
# You can add rules here to execute before the project is built
all-after:
# You can add rules here to execute after the project is built
clean: clean-custom
@echo "Cleaning compiler objects..."
@rm -f $(lite_OBJ)
realclean:
@echo "Cleaning compiler objects and targets..."
@rm -f $(lite_OBJ) lite
###################################################################
##
##//// Targets
##
###################################################################
lite: $(lite_OBJ)
@echo "Linking lite"
@gcc:bin/gcc -o lite $(lite_OBJ) -llua -lSDL2 -lfreetype -lpthread -lauto
@echo "Removing stale debug target: lite"
@rm -f lite.debug
###################################################################
##
##//// Standard rules
##
###################################################################
# A default rule to make all the objects listed below
# because we are hiding compiler commands from the output
.c.o:
@echo "Compiling $<"
@$(CC) -c $< -o $*.o $(CFLAGS)
src/api/api.o: src/api/api.c
src/api/renderer.o: src/api/renderer.c
src/api/renderer_font.o: src/api/renderer_font.c
src/api/system.o: src/api/system.c
src/main.o: src/main.c src/api/api.h src/renderer.h \
src/rencache.o: src/rencache.c src/rencache.h
src/renderer.o: src/renderer.c src/lib/stb/stb_truetype.h
src/lib/stb/stb_truetype.o: src/lib/stb/stb_truetype.c

46
lite.cbp Executable file
View File

@ -0,0 +1,46 @@
<?xml version="1.0" ?>
<CodeBench_Project name="lite" path="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;lite.cbp" created="1387049720" lastmodified="1387055061">
<plugin name="PROGDIR:Plugins&#047;AmigaOS4SDK.CCPlugin" flags="0"/>
<target/>
<homedir name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite"/>
<includedir name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;src"/>
<compiler name="gcc:bin&#047;gcc" switches="-D__USE_INLINE__ -Wall -Werror -Wwrite-strings -Isrc" stack="131072"/>
<linker switches="-lauto"/>
<debugger name="SDK:c&#047;gdb"/>
<builder name="SDK:c&#047;make -f"/>
<environment/>
<headers>
<file name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;src&#047;api&#047;api.h" open="0"/>
<file name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;src&#047;rencache.h" open="0"/>
<file name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;src&#047;lib&#047;stb&#047;stb_truetype.h" open="0"/>
<file name="Applications:Programming&#047;workspace&#047;OtherProjects&#047;lite&#047;src&#047;renderer.h" open="0"/>
</headers>
<sources>
<file name="src&#047;api&#047;api.c" open="0"/>
<file name="src&#047;api&#047;renderer.c" open="0"/>
<file name="src&#047;api&#047;renderer_font.c" open="0"/>
<file name="src&#047;api&#047;system.c" open="0"/>
<file name="src&#047;main.c" open="1" current="1" top="0" left="0" line="119" row="25"/>
<file name="src&#047;rencache.c" open="0"/>
<file name="src&#047;renderer.c" open="0"/>
<file name="src&#047;lib&#047;stb&#047;stb_truetype.c" open="0"/>
</sources>
<flags value="0x0000000000078005"/>
<buildscript name="Makefile" depth="3" open="0"/>
<projectnotes open="0"/>
<buildwindow open="1"/>
<targets>
<target name="lite" linker="gcc:bin&#047;gcc" switches="-llua -lSDL2 -lfreetype -lpthread -lauto" flags="0x00000002">
<file name="src&#047;lib&#047;stb&#047;stb_truetype.c"/>
<file name="src&#047;api&#047;renderer.c"/>
<file name="src&#047;api&#047;renderer_font.c"/>
<file name="src&#047;api&#047;system.c"/>
<file name="src&#047;main.c"/>
<file name="src&#047;api&#047;api.c"/>
<file name="src&#047;rencache.c"/>
<file name="src&#047;renderer.c"/>
</target>
</targets>
<logfile name="RAM Disk:Build.log"/>
<search lastsearch="stbtt_Scale" sensecase="1" replace_state="0"/>
</CodeBench_Project>

BIN
lite.cbp.info Normal file

Binary file not shown.

BIN
lite.info Normal file

Binary file not shown.

View File

@ -1,9 +1,15 @@
#ifndef API_H
#define API_H
#if __amigaos4__
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#else
#include "lib/lua52/lua.h"
#include "lib/lua52/lauxlib.h"
#include "lib/lua52/lualib.h"
#endif
#define API_TYPE_FONT "Font"

View File

@ -38,6 +38,9 @@ static void get_exe_filename(char *buf, int sz) {
#elif __APPLE__
unsigned size = sz;
_NSGetExecutablePath(buf, &size);
#elif __amigaos4__
// TODO: Temporary. Needs to be done properly
strcpy(buf, "Applications:Programming/workspace/MyProjects/lite/lite");
#else
strcpy(buf, "./lite");
#endif