From bb539d253eda3dd597b2c86caf75e8dc9cfec60a Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Tue, 28 Oct 2025 14:47:20 -0700 Subject: [PATCH 1/2] [cmds] Build fsck-dos.os2 and paint.os2 when WATCOM environment installed --- elkscmd/fsck_dos/Makefile | 6 +++++- elkscmd/gui/Makefile.c86 | 4 ++-- elkscmd/gui/Makefile.owc | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/elkscmd/fsck_dos/Makefile b/elkscmd/fsck_dos/Makefile index 461ea6fe0..6a81f01f9 100644 --- a/elkscmd/fsck_dos/Makefile +++ b/elkscmd/fsck_dos/Makefile @@ -11,6 +11,9 @@ LOCALCFLAGS += -Wno-shift-count-overflow ############################################################################### PRGS = fsck-dos +ifdef WATCOM +PRGS += fsck-dos.os2 +endif all: $(PRGS) @@ -37,7 +40,8 @@ fsck-dos: main.o boot.o check.o dir.o fat.o fsck-dos.os2: ewcc -Dlint=1 -DELKS=1 boot.c check.c dir.c fat.c main.c mem.c - ewlink -o fsck-dos.os2 boot.obj check.obj dir.obj fat.obj main.obj mem.obj + ewlink -o $@ boot.obj check.obj dir.obj fat.obj main.obj mem.obj + cp $@ $(TOPDIR)/elkscmd/rootfs_template/bin clean: $(RM) *.o $(PRGS) *.obj *.os2 diff --git a/elkscmd/gui/Makefile.c86 b/elkscmd/gui/Makefile.c86 index 9d2b98207..d3ef0dd8a 100644 --- a/elkscmd/gui/Makefile.c86 +++ b/elkscmd/gui/Makefile.c86 @@ -49,7 +49,7 @@ DEFINES += LOCALFLAGS = BINDIR = . -PROG = $(BINDIR)/cpaint +PROG = $(BINDIR)/paint.c86 SRCS = app.c gui.c input.c render.c event.c mouse.c graphics.c drawbmp.c cursor.c \ drawscanline.c OBJS += vga-c86.o8j @@ -58,7 +58,7 @@ all: $(PROG) $(PROG): $(OBJS) $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) - cp $(PROG) $(TOPDIR)/elkscmd/rootfs_template/bin + cp $@ $(TOPDIR)/elkscmd/rootfs_template/bin clean: rm -f $(PROG) *.o8j *.as *.i *.lst diff --git a/elkscmd/gui/Makefile.owc b/elkscmd/gui/Makefile.owc index a24f65b36..f23f68985 100644 --- a/elkscmd/gui/Makefile.owc +++ b/elkscmd/gui/Makefile.owc @@ -38,7 +38,7 @@ OBJS = $(SRCS:.c=.obj) BINDIR = . LOCALFLAGS = -PROG = $(BINDIR)/opaint +PROG = $(BINDIR)/paint.os2 SRCS = app.c gui.c input.c render.c event.c mouse.c graphics.c drawbmp.c cursor.c SRCS += drawscanline.c @@ -46,7 +46,7 @@ all: $(PROG) $(PROG): $(OBJS) $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) - cp $(PROG) $(TOPDIR)/elkscmd/rootfs_template/bin + cp $@ $(TOPDIR)/elkscmd/rootfs_template/bin clean: rm -f $(PROG) *.obj From b4606c4c196df7e9d8eb8c897cd32275cd87873e Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Tue, 28 Oct 2025 15:30:57 -0700 Subject: [PATCH 2/2] Remove bin/*.os2 bin/*.c86 on make clean --- elkscmd/fsck_dos/.gitignore | 1 + elkscmd/fsck_dos/Makefile | 1 + elkscmd/gui/.gitignore | 4 ++-- elkscmd/gui/Makefile | 4 ---- elkscmd/gui/Makefile.c86 | 9 +++++---- elkscmd/gui/Makefile.gcc | 2 +- elkscmd/gui/Makefile.owc | 9 +++++---- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/elkscmd/fsck_dos/.gitignore b/elkscmd/fsck_dos/.gitignore index 234fbbb7c..6b70ec7c8 100644 --- a/elkscmd/fsck_dos/.gitignore +++ b/elkscmd/fsck_dos/.gitignore @@ -1 +1,2 @@ fsck-dos +fsck-dos.os2 diff --git a/elkscmd/fsck_dos/Makefile b/elkscmd/fsck_dos/Makefile index 6a81f01f9..c03c1b07b 100644 --- a/elkscmd/fsck_dos/Makefile +++ b/elkscmd/fsck_dos/Makefile @@ -45,3 +45,4 @@ fsck-dos.os2: clean: $(RM) *.o $(PRGS) *.obj *.os2 + $(RM) $(TOPDIR)/elkscmd/rootfs_template/bin/fsck-dos.os2 diff --git a/elkscmd/gui/.gitignore b/elkscmd/gui/.gitignore index 16bb1b819..c45396921 100644 --- a/elkscmd/gui/.gitignore +++ b/elkscmd/gui/.gitignore @@ -1,6 +1,6 @@ paint -opaint -cpaint +paint.os2 +paint.c86 *.oaj *.obj *.ocj diff --git a/elkscmd/gui/Makefile b/elkscmd/gui/Makefile index 60523429e..0dcf5a166 100644 --- a/elkscmd/gui/Makefile +++ b/elkscmd/gui/Makefile @@ -23,9 +23,5 @@ c86: clean: make -f Makefile.gcc clean -ifdef WATCOM make -f Makefile.owc clean -endif -ifdef C86 make -f Makefile.c86 clean -endif diff --git a/elkscmd/gui/Makefile.c86 b/elkscmd/gui/Makefile.c86 index d3ef0dd8a..55e8d4d79 100644 --- a/elkscmd/gui/Makefile.c86 +++ b/elkscmd/gui/Makefile.c86 @@ -5,9 +5,9 @@ ifndef TOPDIR $(error ELKS TOPDIR is not defined) endif -ifndef C86 -$(error C86 is not defined) -endif +#ifndef C86 +#$(error C86 is not defined) +#endif CPP=cpp86 CC=c86 @@ -61,4 +61,5 @@ $(PROG): $(OBJS) cp $@ $(TOPDIR)/elkscmd/rootfs_template/bin clean: - rm -f $(PROG) *.o8j *.as *.i *.lst + $(RM) $(PROG) *.o8j *.as *.i *.lst + $(RM) $(TOPDIR)/elkscmd/rootfs_template/bin/$(PROG) diff --git a/elkscmd/gui/Makefile.gcc b/elkscmd/gui/Makefile.gcc index 370c68bbd..73ba062b5 100644 --- a/elkscmd/gui/Makefile.gcc +++ b/elkscmd/gui/Makefile.gcc @@ -49,4 +49,4 @@ vga-ia16.oaj: vga-ia16.o mv vga-ia16.o vga-ia16.oaj clean: - rm -f $(PROG) *.oaj + $(RM) $(PROG) *.oaj diff --git a/elkscmd/gui/Makefile.owc b/elkscmd/gui/Makefile.owc index f23f68985..0190e28d3 100644 --- a/elkscmd/gui/Makefile.owc +++ b/elkscmd/gui/Makefile.owc @@ -5,9 +5,9 @@ ifndef TOPDIR $(error ELKS TOPDIR is not defined) endif -ifndef WATCOM -$(error OpenWatcom WATCOM is not defined) -endif +#ifndef WATCOM +#$(error OpenWatcom WATCOM is not defined) +#endif CC = owcc LD = owcc @@ -49,4 +49,5 @@ $(PROG): $(OBJS) cp $@ $(TOPDIR)/elkscmd/rootfs_template/bin clean: - rm -f $(PROG) *.obj + $(RM) $(PROG) *.obj + $(RM) $(TOPDIR)/elkscmd/rootfs_template/bin/$(PROG)