diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d192768 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +CC=gcc
+#Base Directories
+SRCDIR=src
+BINDIR=bin
+INCDIR=include
+
+#Common flags
+CFLAGS=-I$(INCDIR) -O2 -march=native -flto #-ffast-math
+#tolutils
+TOL_SRCS = $(wildcard $(SRCDIR)/*.c)
+TOL_EXES = $(patsubst $(SRCDIR)/%.c, $(BINDIR)/%.exe, $(TOL_SRCS))
+
+# Setup target
+setup:
+ mkdir -p $(BINDIR) $(INCDIR)
+
+all: setup tolsac structure
+
+tolsac: $(TOL_EXES)
+$(BINDIR)/%.exe: $(SRCDIR)/%.c
+ $(CC) $< $(CFLAGS) -o $@
+
+clean:
+ rm -f $(BINDIR)/*
+ rm -f structure.txt
+
+rebuild: clean all
+
+# Generate project structure
+structure:
+ @powershell -Command "(Get-Item .).Name | Set-Content structure.txt; (tree /a /f | Select-Object -Skip 3) | Add-Content structure.txt"
|