diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Makefile | 34 | ||||
| -rw-r--r-- | README.md | 0 | ||||
| -rw-r--r-- | src/main.c | 6 |
4 files changed, 43 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2bc8ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# ignore C files +**/*.o +bin/
\ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f07c32b --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +CC ?= gcc +CFLAGS := -Wall -O2 -std=c99 +LDFLAGS := +LDLIBS := + +SRCDIR := src +BINDIR := bin +OBJDIR := obj +DIRS := $(SRCDIR) $(BINDIR) $(OBJDIR) + +SRC := $(shell find $(SRCDIR) -type f -printf "%f ") +DEPS := $(OBJ:.o=.d) +OBJ := $(SRC:%.c=$(OBJDIR)/%.o) + +TARGET := $(BINDIR)/cgit_auth + +# Rules +.PHONY: all clean + +all: $(TARGET) + +$(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR) + $(CC) $(CFLAGS) -o $@ -c $< + +$(DIRS): + @mkdir -p $@ + +-include $(DEPS) + +$(TARGET): $(OBJ) | $(BINDIR) + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) $(LDLIBS) + +clean: + rm -rf $(BINDIR) $(OBJDIR) diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..a0318ef --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char **argv) { + return 0; +} |
