C言語の最低限の処理

This commit is contained in:
ry.yamafuji 2025-12-07 19:05:38 +09:00
parent 906cc65b3d
commit 2e84f898eb
4 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
dist/
# ---> C++ # ---> C++
# Prerequisites # Prerequisites
*.d *.d

11
Makefile Normal file
View File

@ -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)

1
readme/c.md Normal file
View File

@ -0,0 +1 @@
# C言語について

10
src/hello.c Normal file
View File

@ -0,0 +1,10 @@
/** Hello world program in C
* command: gcc src/hello.c -o dist/hello
* run: ./dist/hello
*/
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
}