Remove pthead windows submodule. remove makefile. add in simple .bat and .sh to build project
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "ext/pthreads4w-code"]
|
||||
path = ext/pthreads4w-code
|
||||
url = https://git.code.sf.net/p/pthreads4w/code
|
||||
5
build.sh
Normal file
5
build.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
(
|
||||
cd bin
|
||||
srcs=../src/*
|
||||
cl $srcs -I ../inc/ -Od -std:c++20 -Fe main.exe
|
||||
)
|
||||
Submodule ext/pthreads4w-code deleted from 8e467a62a1
61
makefile
61
makefile
@@ -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
|
||||
1
run_before_build.bat
Normal file
1
run_before_build.bat
Normal file
@@ -0,0 +1 @@
|
||||
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && bash
|
||||
Reference in New Issue
Block a user