Removed the sh script and made a better Makefile

This commit is contained in:
George Sokianos 2022-02-05 13:25:29 +00:00
parent b919e5b942
commit ddb81648c2
2 changed files with 62 additions and 39 deletions

View File

@ -3,19 +3,76 @@
# #
# Created on: 26-12-2021 # Created on: 26-12-2021
# #
.PHONY: build release
default: build LiteXL_OBJ := \
src/dirmonitor.o src/main.o src/rencache.o src/renderer.o \
src/renwindow.o src/api/api.o src/api/regex.o \
src/api/renderer.o src/api/system.o src/platform/amigaos4.o
outfile := lite
compiler := gcc
cxxcompiler := g++
INCPATH := -Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 -I/sdk/local/common/include/freetype2
DFLAGS := -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR
# -DLITE_USE_SDL_RENDERER
# -Wextra -Wall
CFLAGS := -Werror -Wwrite-strings -O3 -g -std=gnu11 -fno-strict-aliasing
# "-gstabs -finstrument-functions -fno-inline -DPROFILING"
LFLAGS := -mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lpcre2 -lSDL2 -llua -lagg -lfreetype -lm -lunix -lpthread -athread=native
# " -lprofyle"
.PHONY: LiteXL clean release
default: LiteXL
clean:
@echo "Cleaning compiler objects..."
@rm -f $(LiteXL_OBJ)
LiteXL: $(LiteXL_OBJ)
@echo "Linking LiteXL"
@$(cxxcompiler) -o $(outfile) $(LiteXL_OBJ) $(LFLAGS)
.c.o:
@echo "Compiling $<"
@$(compiler) -c $< -o $*.o $(CFLAGS) $(INCPATH) $(DFLAGS)
src/dirmonitor.o: src/dirmonitor.c src/platform/amigaos4.h
src/main.o: src/main.c src/api/api.h src/rencache.h \
src/renderer.h src/platform/amigaos4.h src/dirmonitor.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/platform/amigaos4.o: src/platform/amigaos4.c
build:
@sh os4build.sh
release: release:
mkdir -p release/LiteXL mkdir -p release/LiteXL
cp release_files/* release/LiteXL/ -r cp release_files/* release/LiteXL/ -r
mv release/LiteXL/LiteXL.info release/ mv release/LiteXL/LiteXL.info release/
cp data release/LiteXL/ -r cp data release/LiteXL/ -r
cp doc release/LiteXL/ -r cp changelog.md release/LiteXL/
cp lite release/LiteXL/ cp lite release/LiteXL/
strip release/LiteXL/lite strip release/LiteXL/lite
cp README.md release/LiteXL/ cp README.md release/LiteXL/

View File

@ -1,34 +0,0 @@
#!/bin/bash
outfile="lite"
compiler="gcc"
cxxcompiler="g++"
INCPATH="-Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 -I/sdk/local/common/include/freetype2"
DFLAGS="-D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR -DLITE_USE_SDL_RENDERER"
CFLAGS="-Wall -O3 -g -std=gnu11 -fno-strict-aliasing"
LFLAGS="-mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lpcre2 -lSDL2 -llua -lagg -lfreetype -lm -lunix -lpthread -athread=native"
echo "compiling lite..."
# $compiler -c src/dirmonitor.c -o dirmonitor.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/main.c -o main.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/rencache.c -o rencache.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/renderer.c -o renderer.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/renwindow.c -o renwindow.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/api/api.c -o api.o $CFLAGS $INCPATH $DFLAGS
# $compiler -c src/api/process.c -o process.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/api/regex.c -o regex.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/api/renderer.c -o apirenderer.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/api/system.c -o system.o $CFLAGS $INCPATH $DFLAGS
$compiler -c src/platform/amigaos4.c -o amigaos4.o $CFLAGS $INCPATH $DFLAGS
echo "linking..."
$cxxcompiler -o $outfile *.o $LFLAGS
echo "cleaning up..."
rm *.o
echo "done"