diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/Makefile b/Makefile index e18d787..ddac678 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ CC="/usr/bin/gcc" # CC="E:\\impressionyang\\scoop\\apps\\mingw\\12.2.0\\bin\\gcc.exe" PROJECT=test +BUILD_DIR=build # check operating system type ifeq ($(OS), Windows_NT) @@ -64,7 +65,8 @@ INC_DIRS := $(wordlist 1, $(words $(INC_DIRS)), $(INC_DIRS)) # compile job all : - $(CC) $(CFLAGS) $(SOURCES) $(HEADERS) $(INC_DIRS) -o $(PROJECT) + mkdir -p $(BUILD_DIR) + $(CC) $(CFLAGS) $(SOURCES) $(HEADERS) $(INC_DIRS) -o $(BUILD_DIR)/$(PROJECT) # virtual clean job .PHONY : clean diff --git a/main.c b/main.c new file mode 100644 index 0000000..69f173c --- /dev/null +++ b/main.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, char const *argv[]) +{ + printf("hello world!\r\n"); + return 0; +}