From 13732c215e72f68647ff83e3d43283b470dd84c4 Mon Sep 17 00:00:00 2001 From: impressionyang Date: Mon, 12 Aug 2024 17:17:43 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E2=9A=A1=EF=B8=8F=20:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Makefile | 4 +++- main.c | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 main.c 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; +}