Skip to content

Commit 648c1ad

Browse files
committed
Update both main and master to the portable build and startup changes.
1 parent 70028b7 commit 648c1ad

11 files changed

Lines changed: 503 additions & 342 deletions

File tree

‎build.xml‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
-->
2121
<project name="NitroWebExpress" default="compile" basedir=".">
2222

23-
<!-- Properties -->
2423
<property name="src.dir" value="source"/>
2524
<property name="out.dir" value="out"/>
2625
<property name="jar.file" value="nwe.jar"/>
@@ -29,10 +28,9 @@
2928
<property name="mysql.jar" value="${jars.dir}/mysql/mysql-connector-j-9.7.0.jar"/>
3029
<property name="lanterna.jar" value="${jars.dir}/lanterna-3.1.5.jar"/>
3130
<property name="jpcap.dir" value="${jars.dir}/jpcap"/>
32-
<property name="java.release" value="25"/>
31+
<property name="java.release" value="21"/>
3332
<property name="repo.url" value="https://github.com/mearvk/Java.Web.Server.Telnet.Front.Java.21"/>
3433

35-
<!-- Classpath -->
3634
<path id="compile.classpath">
3735
<fileset dir="${djl.dir}" includes="*.jar" erroronmissingdir="false"/>
3836
<fileset dir="${jpcap.dir}" includes="*.jar" erroronmissingdir="false"/>
@@ -41,33 +39,29 @@
4139
<pathelement location="${out.dir}"/>
4240
</path>
4341

44-
<!-- ═══ CLEAN ═══════════════════════════════════════════════════════════ -->
4542
<target name="clean" description="Remove compiled output and JAR">
4643
<delete dir="${out.dir}" quiet="true"/>
4744
<delete file="${jar.file}" quiet="true"/>
4845
<echo message="Cleaned."/>
4946
</target>
5047

51-
<!-- ═══ COMPILE ═════════════════════════════════════════════════════════ -->
5248
<target name="compile" depends="structure" description="Compile all Java sources">
5349
<mkdir dir="${out.dir}"/>
5450
<javac srcdir="${src.dir}"
55-
destdir="${out.dir}"
56-
release="${java.release}"
57-
includeantruntime="false"
58-
fork="true"
59-
failonerror="true">
51+
destdir="${out.dir}"
52+
release="${java.release}"
53+
includeantruntime="false"
54+
fork="true"
55+
failonerror="true">
6056
<classpath refid="compile.classpath"/>
6157
</javac>
6258
<echo message="Compilation successful."/>
6359
</target>
6460

65-
<!-- ═══ JAR ═════════════════════════════════════════════════════════════ -->
6661
<target name="jar" depends="compile" description="Build fat JAR">
6762
<jar destfile="${jar.file}" basedir="${out.dir}">
6863
<manifest>
6964
<attribute name="Main-Class" value="Main"/>
70-
<attribute name="Class-Path" value="jars/djl/pytorch-native-cpu-2.5.1-linux-x86_64.jar"/>
7165
</manifest>
7266
<zipgroupfileset dir="${jars.dir}/mysql" includes="mysql-connector-j-9.7.0.jar"/>
7367
<zipgroupfileset file="${lanterna.jar}"/>
@@ -77,7 +71,6 @@
7771
<echo message="Built ${jar.file} (${jar.file})"/>
7872
</target>
7973

80-
<!-- ═══ RUN ═════════════════════════════════════════════════════════════ -->
8174
<target name="run" depends="compile" description="Run from compiled classes">
8275
<java classname="Main" fork="true" failonerror="true">
8376
<classpath refid="compile.classpath"/>
@@ -87,7 +80,6 @@
8780
</java>
8881
</target>
8982

90-
<!-- ═══ RUN-JAR ═════════════════════════════════════════════════════════ -->
9183
<target name="run-jar" description="Run from nwe.jar">
9284
<java jar="${jar.file}" fork="true" failonerror="true">
9385
<jvmarg value="-Dnwe.root=${basedir}"/>
@@ -98,7 +90,6 @@
9890
</java>
9991
</target>
10092

101-
<!-- ═══ UPDATE ══════════════════════════════════════════════════════════ -->
10293
<target name="update" description="Pull latest, recompile, rebuild JAR">
10394
<echo message="Pulling latest from GitHub..."/>
10495
<exec executable="git" failonerror="true">
@@ -112,7 +103,6 @@
112103
<echo message="Update complete. Scripts, sources, and JAR rebuilt."/>
113104
</target>
114105

115-
<!-- ═══ TEST ════════════════════════════════════════════════════════════ -->
116106
<target name="test" description="Run port connectivity tests">
117107
<exec executable="bash" failonerror="false">
118108
<arg value="scripts/bash/49111/test.49111.check.sh"/>
@@ -123,14 +113,12 @@
123113
<echo message="Tests complete."/>
124114
</target>
125115

126-
<!-- ═══ STRUCTURE ═══════════════════════════════════════════════════════ -->
127116
<target name="structure" description="Regenerate STRUCTURE.txt from codebase scan">
128117
<exec executable="bash" failonerror="false">
129118
<arg value="scripts/generate-structure.sh"/>
130119
</exec>
131120
</target>
132121

133-
<!-- ═══ STRIPS ══════════════════════════════════════════════════════════ -->
134122
<target name="strips" description="Validate AI learning strips exist">
135123

136124
<available file="source/strernary/strips/base-learning-strip.tsv" property="strip.strernary"/>

‎linux/c/Makefile‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
CC = gcc
2-
CFLAGS = -std=c11 -O2 -Wall -Wextra -I.
1+
# Cross-platform C build for Linux, macOS, and Windows (MinGW/MSYS2)
2+
# Supports a GNU-like make environment. On Windows, use a shell such as Git Bash,
3+
# MSYS2, or a MinGW toolchain where `gcc`, `ar`, and `find` are available.
4+
5+
CC ?= gcc
6+
AR ?= ar
7+
RM ?= rm -f
8+
CPPFLAGS ?= -I.
9+
CFLAGS ?= -std=c11 -O2 -Wall -Wextra
10+
11+
UNAME_S := $(shell uname -s 2>/dev/null)
12+
ifeq ($(OS),Windows_NT)
13+
SRCS := $(shell dir /s /b *.c 2>nul)
14+
else
15+
SRCS := $(shell find . -name '*.c' -print)
16+
endif
317

4-
# find all .c files recursively under this directory
5-
SRCS := $(shell find . -name '*.c')
618
OBJS := $(SRCS:.c=.o)
719
LIB := libconverted.a
820
APP := app
@@ -11,19 +23,14 @@ APP := app
1123

1224
all: $(LIB) $(APP)
1325

14-
# archive library of all objects
1526
$(LIB): $(OBJS)
16-
ar rcs $@ $(OBJS)
27+
$(AR) rcs $@ $(OBJS)
1728

18-
# example executable linking Main.c and the library
19-
# If Main.c does not exist, this target will still attempt to build (no-op)
2029
$(APP): $(LIB) ./Main.o
21-
$(CC) $(CFLAGS) -o $@ ./Main.o $(LIB)
30+
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ ./Main.o $(LIB)
2231

23-
# generic rule to compile .c -> .o
2432
%.o: %.c
25-
$(CC) $(CFLAGS) -c $< -o $@
33+
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
2634

2735
clean:
28-
rm -f $(OBJS) $(LIB) $(APP)
29-
36+
$(RM) $(OBJS) $(LIB) $(APP)

‎linux/c/README.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@
22

33
<img align="right" width="75" height="75" src="https://raw.githubusercontent.com/mearvk/SLeeLa/master/images/debian-logo.png" alt="Debian logo">
44

5-
This directory contains C source files for Linux.
5+
This directory contains portable C source files intended to build on Linux, macOS,
6+
and Windows with a Unix-like shell toolchain (for example: GCC + MSYS2/MinGW or a standard GNU make environment).
7+
8+
Build steps:
9+
10+
make
11+
make clean
12+
13+
If you are using Windows without a Unix-like shell, install MSYS2 or Git Bash so the
14+
`find`, `gcc`, and `ar` toolchain is available to GNU make.

0 commit comments

Comments
 (0)