diff --git a/3rdparty/stb_ds.h b/3rdparty/stbds.h similarity index 100% rename from 3rdparty/stb_ds.h rename to 3rdparty/stbds.h diff --git a/3rdparty/stb_image.h b/3rdparty/stbimage.h similarity index 100% rename from 3rdparty/stb_image.h rename to 3rdparty/stbimage.h diff --git a/Makefile b/Makefile index c6dbfc3..cb4e8f2 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ DXE3GEN := dxe3gen EXE2COFF := exe2coff # Compiler Settings -CFLAGS := -DPLATFORM_DOS -Wall +CFLAGS := -DPLATFORM_DOS -Wall -MD LDFLAGS := # Output Directories @@ -50,17 +50,11 @@ FONT_SRC := $(shell find font/src -name '*.c') FONT_OBJ := $(FONT_SRC:%=$(OBJ)/%.o) FONT_LIB := -lm -# Roo/E Dynamic Libraries -DYNS_EXE := stbimage.dyn -DYNS_SRC := $(shell find dyn/stbimage -name '*.c') -DYNS_OBJ := $(DYNS_SRC:%=$(OBJ)/%.o) -DYNS_LIB := - # Roo/E Source and Target ROOE_EXE := roo_e.exe ROOE_SRC := $(shell find roo_e -name '*.c') ROOE_OBJ := $(ROOE_SRC:%=$(OBJ)/%.o) -ROOE_LIB := 3rdparty/pthreads/lib/libgthreads.a -lgcc +ROOE_LIB := 3rdparty/pthreads/lib/libgthreads.a -lgcc -lm # MultiPlayer Game Client MPGC_EXE := kpsmpgc.app @@ -68,13 +62,17 @@ MPGC_SRC := $(shell find kpsmpgc -name '*.c') MPGC_OBJ := $(MPGC_SRC:%=$(OBJ)/%.o) MPGC_LIB := -FONTS := $(FNT)/vga4x8.fnt $(FNT)/vga8x8.fnt $(FNT)/vga8x14.fnt $(FNT)/vga8x16.fnt +DYNS := kpsvideo stbimage +FONTS := vga4x8 vga8x8 vga8x14 vga8x16 # Wiring -FONT_PNGS := $(subst $(FNT),$(FIN),$(FONTS)) -FONT_PNGS := $(subst .fnt,.png,$(FONTS_PNGS)) -INC_FLAGS := $(addprefix -I,$(INC)) -CFLAGS += $(INC_FLAGS) +INC_FLAGS := $(addprefix -I,$(INC)) +CFLAGS += $(INC_FLAGS) +APP_OBJS := $(ROOE_OBJ) $(MPGC_OBJ) +FONTS := $(addprefix $(FNT)/,$(addsuffix .fnt,$(FONTS))) +FONT_PNGS := $(subst .fnt,.png,$(subst $(FNT),$(FIN),$(FONTS))) +DYN_FILES := $(foreach DIR,$(DYNS),$(DYN)/$(DIR).dyn) +DYN_SOURCE := $(foreach DIR,$(DYNS),$(shell find dyn/$(DIR) -name '*.c' -or -name '*.h')) # Force User to Run This Using Toolchains .PHONY: use_build_script @@ -83,7 +81,7 @@ use_build_script: # Build Everything .PHONY: dos -dos: $(BIN)/$(ROOE_EXE) $(APP)/$(MPGC_EXE) $(DYN)/$(DYNS_EXE) +dos: $(BIN)/$(ROOE_EXE) $(APP)/$(MPGC_EXE) $(DYN_FILES) .PHONY: linux linux: $(FONTS) @@ -98,7 +96,7 @@ $(BIN)/$(FONT_ELF): $(FONT_OBJ) Makefile mkdir -p $(dir $@) $(BIN)/fonts $(CC) $(FONT_OBJ) -o $@ $(LDFLAGS) $(FONT_LIB) -$(FONTS) &: $(FIN)/vga4x8.png $(FIN)/vga4x8.png $(FIN)/vga4x8.png $(FIN)/vga4x8.png $(BIN)/$(FONT_ELF) +$(FONTS) &: $(FONT_PNGS) $(BIN)/$(FONT_ELF) cd $(BIN) && ./$(FONT_ELF) # Roo/E Target @@ -115,15 +113,21 @@ $(APP)/$(MPGC_EXE): $(MPGC_OBJ) Makefile mkdir -p $(dir $@) $(DXE3GEN) -o $@ $(MPGC_OBJ) -U $(LDFLAGS) $(MPGC_LIB) -# DYNS Target -$(DYN)/$(DYNS_EXE): $(DYNS_OBJ) Makefile - mkdir -p $(dir $@) - $(AR) rcs $(OBJ)/$(DYNS_EXE).a $(DYNS_OBJ) - $(DXE3GEN) -o $@ -Y $@.a --whole-archive -U $(OBJ)/$(DYNS_EXE).a $(LDFLAGS) $(DYNS_LIB) - mkdir -p $(SDK) - mv $(DYN)/$(DYNS_EXE).a $(SDK)/. +# DYN Targets +.PHONY: dyns +$(DYN_FILES): $(DYN_SOURCE) Makefile + echo $(DYN_SOURCE) + mkdir -p $(DYN) $(OBJ)/dyn/$(basename $(notdir $@)) $(SDK)/lib $(SDK)/include + $(foreach CFILE,$(shell find dyn/$(basename $(notdir $@)) -name '*.c'),$(CC) $(CFLAGS) -o $(OBJ)/dyn/$(basename $(notdir $@))/$(subst dyn/$(basename $(notdir $@))/,,$(CFILE).o) -c $(CFILE) && ) true + $(AR) rcs $(OBJ)/dyn/$(basename $(notdir $@)).a $(OBJ)/dyn/$(basename $(notdir $@))/*.o + $(DXE3GEN) -o $@ -Y $@.a --whole-archive -U $(OBJ)/dyn/$(basename $(notdir $@)).a $(LDFLAGS) + mv $@.a $(SDK)/lib/. + if [ ! -z "$(shell find dyn/$(basename $(notdir $@)) -name '*.h')" ]; then cp $(shell find dyn/$(basename $(notdir $@)) -name '*.h') $(SDK)/include/.; fi # Build C Files $(OBJ)/%.c.o: %.c mkdir -p $(dir $@) $(CC) $(CFLAGS) -c $< -o $@ + +# Track Header Changes in APPs and Roo/E +-include $(APP_OBJS:.o=.d) diff --git a/dyn/kpsvideo/kpsvideo.c b/dyn/kpsvideo/kpsvideo.c new file mode 100644 index 0000000..4093ed6 --- /dev/null +++ b/dyn/kpsvideo/kpsvideo.c @@ -0,0 +1,31 @@ +/* Roo/E, the Kangaroo Punch Portable GUI Toolkit + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ + + +#include "kpsvideo.h" + +#include + +int dynStart(void) { + printf("kpsvideo starting!\n"); + return 0; +} diff --git a/dyn/kpsvideo/kpsvideo.h b/dyn/kpsvideo/kpsvideo.h new file mode 100644 index 0000000..9d54738 --- /dev/null +++ b/dyn/kpsvideo/kpsvideo.h @@ -0,0 +1,27 @@ +/* Roo/E, the Kangaroo Punch Portable GUI Toolkit + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ + + +#ifndef KPSVIDEO_H +#define KPSVIDEO_H + +#endif // KPSVIDEO_H diff --git a/dyn/stbimage/stbimage.c b/dyn/stbimage/stbimage.c index 4ccec0e..6450b6c 100644 --- a/dyn/stbimage/stbimage.c +++ b/dyn/stbimage/stbimage.c @@ -1,30 +1,30 @@ /* Roo/E, the Kangaroo Punch Portable GUI Toolkit -* Copyright (C) 2026 Scott Duensing -* -* http://kangaroopunch.com -* -* -* This file is part of Roo/E. -* -* Roo/E is free software: you can redistribute it and/or modify it under the -* terms of the GNU Affero General Public License as published by the Free -* Software Foundation, either version 3 of the License, or (at your option) -* any later version. -* -* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Roo/E. If not, see . -*/ + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ #include #define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" +#include "stbimage.h" int dynStart(void) { diff --git a/font/src/main.c b/font/src/main.c index 5292969..ad10c0f 100644 --- a/font/src/main.c +++ b/font/src/main.c @@ -1,24 +1,24 @@ /* Roo/E, the Kangaroo Punch Portable GUI Toolkit -* Copyright (C) 2026 Scott Duensing -* -* http://kangaroopunch.com -* -* -* This file is part of Roo/E. -* -* Roo/E is free software: you can redistribute it and/or modify it under the -* terms of the GNU Affero General Public License as published by the Free -* Software Foundation, either version 3 of the License, or (at your option) -* any later version. -* -* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Roo/E. If not, see . -*/ + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ #include @@ -30,7 +30,7 @@ #define STB_IMAGE_IMPLEMENTATION #define STBI_ONLY_PNG -#include "stb_image.h" +#include "stbimage.h" #include "stddclmr.h" diff --git a/kpsmpgc/main.c b/kpsmpgc/main.c index 2bb26bd..7aa63f1 100644 --- a/kpsmpgc/main.c +++ b/kpsmpgc/main.c @@ -1,28 +1,28 @@ /* Roo/E, the Kangaroo Punch Portable GUI Toolkit -* Copyright (C) 2026 Scott Duensing -* -* http://kangaroopunch.com -* -* -* This file is part of Roo/E. -* -* Roo/E is free software: you can redistribute it and/or modify it under the -* terms of the GNU Affero General Public License as published by the Free -* Software Foundation, either version 3 of the License, or (at your option) -* any later version. -* -* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Roo/E. If not, see . -*/ + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ #include -#include "stb_image.h" +#include "stbimage.h" void __attribute__((constructor)) registerApp(void) { diff --git a/roo_e/main.c b/roo_e/main.c index e0f6f4f..fbf1929 100644 --- a/roo_e/main.c +++ b/roo_e/main.c @@ -34,7 +34,7 @@ #include "util.h" #define STB_DS_IMPLEMENTATION -#include "stb_ds.h" +#include "stbds.h" int startApp(const char *appName, int argc, char *argv[]); diff --git a/roo_e/util.c b/roo_e/util.c index 0d4f44f..0605a4f 100644 --- a/roo_e/util.c +++ b/roo_e/util.c @@ -1,24 +1,24 @@ /* Roo/E, the Kangaroo Punch Portable GUI Toolkit -* Copyright (C) 2026 Scott Duensing -* -* http://kangaroopunch.com -* -* -* This file is part of Roo/E. -* -* Roo/E is free software: you can redistribute it and/or modify it under the -* terms of the GNU Affero General Public License as published by the Free -* Software Foundation, either version 3 of the License, or (at your option) -* any later version. -* -* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Roo/E. If not, see . -*/ + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ #include diff --git a/roo_e/util.h b/roo_e/util.h index 5af9e53..c93e488 100644 --- a/roo_e/util.h +++ b/roo_e/util.h @@ -1,24 +1,24 @@ /* Roo/E, the Kangaroo Punch Portable GUI Toolkit -* Copyright (C) 2026 Scott Duensing -* -* http://kangaroopunch.com -* -* -* This file is part of Roo/E. -* -* Roo/E is free software: you can redistribute it and/or modify it under the -* terms of the GNU Affero General Public License as published by the Free -* Software Foundation, either version 3 of the License, or (at your option) -* any later version. -* -* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -* details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Roo/E. If not, see . -*/ + * Copyright (C) 2026 Scott Duensing + * + * http://kangaroopunch.com + * + * + * This file is part of Roo/E. + * + * Roo/E is free software: you can redistribute it and/or modify it under the + * terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Roo/E. If not, see . + */ #ifndef UTIL_H