diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..bf9cabf58618524334c75cdb596180dab3bc7b0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,51 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf diff --git a/README.md b/README.md index 229684660ee3f291ddf813fa8a26e1ea75125c45..c0af782cdfad277e95f4f430726632b07c0a1a68 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ -# stack +# Stack +``` +📦project + ┣ 📂include + ┃ ┗ 📜.h + ┣ 📂Sources + ┃ ┣ 📜main.c + ┃ ┗ 📜.c + ┣ 📜.gitignore + ┣ 📜makefile + ┗ 📜README.md + ``` \ No newline at end of file diff --git a/Sources/main.c b/Sources/main.c new file mode 100644 index 0000000000000000000000000000000000000000..7bc609693eb997f86609b6aa55281e7ef742552c --- /dev/null +++ b/Sources/main.c @@ -0,0 +1,7 @@ +#include <stdio.h> +#include "../include/pile.h" + +int main(void) { + helloworld(); + return 0; +} \ No newline at end of file diff --git a/Sources/stack.c b/Sources/stack.c new file mode 100644 index 0000000000000000000000000000000000000000..6649abea36aec184033ada3c294d59691b3c20b3 --- /dev/null +++ b/Sources/stack.c @@ -0,0 +1,6 @@ +#include "../include/pile.h" +#include <stdio.h> + +void helloworld(){ + printf("helloworld\n"); +} \ No newline at end of file diff --git a/include/stack.h b/include/stack.h new file mode 100644 index 0000000000000000000000000000000000000000..24b2c11777437ca3976f0efb96ba712da105e300 --- /dev/null +++ b/include/stack.h @@ -0,0 +1,7 @@ +#ifndef PILE_H +#define PILE_H + +void helloworld(); + + +#endif \ No newline at end of file diff --git a/makefile b/makefile new file mode 100644 index 0000000000000000000000000000000000000000..f3c5682a541f2d3ed52c14127720d9830a4df96f --- /dev/null +++ b/makefile @@ -0,0 +1,30 @@ +SRC_DIR := Sources +OBJ_DIR := obj +BIN_DIR := bin + +EXE := $(BIN_DIR)/stack.exe #exe name +SRC := $(wildcard $(SRC_DIR)/*.c) +OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) + +CPPFLAGS := -Iinclude -MMD -MP +CFLAGS := -Wall +LDFLAGS := -Llib +LDLIBS := -lm + +.PHONY: all clean + +all: $(EXE) + +$(EXE): $(OBJ) | $(BIN_DIR) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + +$(BIN_DIR) $(OBJ_DIR): + mkdir -p $@ + +clean: + @$(RM) -rv $(BIN_DIR) $(OBJ_DIR) + +-include $(OBJ:.o=.d) \ No newline at end of file