diff options
-rw-r--r-- | helloworld.c | 6 | ||||
-rw-r--r-- | makefile | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/helloworld.c b/helloworld.c new file mode 100644 index 0000000..ef66efb --- /dev/null +++ b/helloworld.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +int main() { + printf("Hello, World!\n"); + return 0; +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..4d538da --- /dev/null +++ b/makefile @@ -0,0 +1,24 @@ +CC = gcc +LD = gcc +RM = rm -f +CFLAGS = +LFLAGS = +TARGET = main + +SRCS := $(wildcard *.c) +OBJS := $(patsubst %.c,%.o, $(SRCS)) + +all: main + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +$(TARGET): $(OBJS) + $(LD) $^ $(LFLAGS) -o $@ + +clean: + $(RM) $(TARGET) $(OBJS) + +compile_commands: clean + compiledb make + |