From d2c7059d3d7261eeaa01cb1b20704c16813a6241 Mon Sep 17 00:00:00 2001 From: Seth Hamilton Date: Sat, 6 Sep 2025 23:22:45 -0500 Subject: [PATCH] Remove pthead windows submodule. remove makefile. add in simple .bat and .sh to build project --- .gitmodules | 3 --- build.sh | 5 ++++ ext/pthreads4w-code | 1 - makefile | 61 -------------------------------------------- run_before_build.bat | 1 + 5 files changed, 6 insertions(+), 65 deletions(-) delete mode 100644 .gitmodules create mode 100644 build.sh delete mode 160000 ext/pthreads4w-code delete mode 100644 makefile create mode 100644 run_before_build.bat diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a3b469a..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "ext/pthreads4w-code"] - path = ext/pthreads4w-code - url = https://git.code.sf.net/p/pthreads4w/code diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..b2f051e --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +( + cd bin + srcs=../src/* + cl $srcs -I ../inc/ -Od -std:c++20 -Fe main.exe +) diff --git a/ext/pthreads4w-code b/ext/pthreads4w-code deleted file mode 160000 index 8e467a6..0000000 --- a/ext/pthreads4w-code +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e467a62a14fd9de15af33beec0a913d23f4d2f9 diff --git a/makefile b/makefile deleted file mode 100644 index e625861..0000000 --- a/makefile +++ /dev/null @@ -1,61 +0,0 @@ -src_files = $(shell find src -iname "*.cpp") -obj_files = $(src_files:src/%.cpp=obj/%.o) - - -ifeq ($(OS),Windows_NT) - CCFLAGS += -D WIN32 -Iext/PTHREADS-BUILT/include -std=c++20 - PTHREADLIB = ext/PTHREADS-BUILT/lib/pthreadVCE3.lib - ifeq ($(PROCESSOR_ARCHITEW6432),AMD64) - CCFLAGS += -D AMD64 - else - ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) - CCFLAGS += -D AMD64 - endif - ifeq ($(PROCESSOR_ARCHITECTURE),x86) - CCFLAGS += -D IA32 - endif - endif -else - UNAME_S := $(shell uname -s) - ifeq ($(UNAME_S),Linux) - CCFLAGS += -D LINUX - endif - ifeq ($(UNAME_S),Darwin) - CCFLAGS += -D OSX - endif - UNAME_P := $(shell uname -p) - ifeq ($(UNAME_P),x86_64) - CCFLAGS += -D AMD64 - endif - ifneq ($(filter %86,$(UNAME_P)),) - CCFLAGS += -D IA32 - endif - ifneq ($(filter arm%,$(UNAME_P)),) - CCFLAGS += -D ARM - endif -endif - -debug: OPTIMIZATION_FLAG = -g -release: OPTIMIZATION_FLAG = -O3 - -release: all export_comp_db - -debug: all export_comp_db - -all: $(obj_files) - @ mkdir -p bin - g++ -I inc/ $^ $(PTHREADLIB) -o bin/main $(OPTIMIZATION_FLAG) $(CCFLAGS) - -obj/%.o: src/%.cpp - @ mkdir -p obj - g++ -I inc/ -c $< -o $@ $(OPTIMIZATION_FLAG) $(CCFLAGS) - -export_comp_db: - echo [ > compile_commands.json - make debug -B --dry-run > temp - awk '/g\+\+.*\.cpp/ { f="compile_commands.json"; printf "\t\{\n\t\t\"directory\": \"%s\",\n\t\t\"command\": \"%s\",\n\t\t\"file\": \"%s\"\n\t\},\n", ENVIRON["PWD"], $$0, $$5 >> f }' temp - echo ] >> compile_commands.json - rm temp - -clean: - rm -f obj/*.o bin/*.exe diff --git a/run_before_build.bat b/run_before_build.bat new file mode 100644 index 0000000..8a4e494 --- /dev/null +++ b/run_before_build.bat @@ -0,0 +1 @@ +"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && bash