diff --git a/.gitignore b/.gitignore index e257658..a5b2030 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +dist/ # ---> C++ # Prerequisites *.d diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d148c63 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +CC = gcc +CFLAGS = -Wall -Wextra -O2 + +TARGET = dist/hello +SRC = src/hello.c + +$(TARGET): $(SRC) + $(CC) $(CFLAGS) $(SRC) -o $(TARGET) + +clean: + rm -f $(TARGET) \ No newline at end of file diff --git a/readme/c.md b/readme/c.md new file mode 100644 index 0000000..e560080 --- /dev/null +++ b/readme/c.md @@ -0,0 +1 @@ +# C言語について \ No newline at end of file diff --git a/src/hello.c b/src/hello.c new file mode 100644 index 0000000..52fe27f --- /dev/null +++ b/src/hello.c @@ -0,0 +1,10 @@ +/** Hello world program in C +* command: gcc src/hello.c -o dist/hello +* run: ./dist/hello +*/ +#include + +int main(void) { + printf("Hello, world!\n"); + return 0; +} \ No newline at end of file