diff options
author | admin <contact@optics-design.com> | 2025-04-25 21:13:44 +0200 |
---|---|---|
committer | admin <contact@optics-design.com> | 2025-04-25 21:13:44 +0200 |
commit | 0a64ff62830495ea21bdafe33b6166c3955d35fd (patch) | |
tree | aa87337e5691275ceaa7300c88ba4f2d2c2778e4 /Makefile |
First Commit
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"
|