aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--all.do3
-rw-r--r--default.o.do4
-rw-r--r--license21
-rw-r--r--main.cpp7
-rw-r--r--makefile8
6 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..31b4695
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+all
+
+*.d
+*.o
+.dep.*
+.depend.*
+.lock.*
+.target.*
diff --git a/all.do b/all.do
new file mode 100644
index 0000000..5908152
--- /dev/null
+++ b/all.do
@@ -0,0 +1,3 @@
+DEPS="main.o"
+redo-ifchange $DEPS
+gcc -o "$3" $DEPS
diff --git a/default.o.do b/default.o.do
new file mode 100644
index 0000000..ae34754
--- /dev/null
+++ b/default.o.do
@@ -0,0 +1,4 @@
+redo-ifchange "$2.cpp"
+g++ -MD -MF "$2.d" -c -o "$3" "$2.cpp"
+read DEPS < "$2.d"
+redo-ifchange ${DEPS#*:}
diff --git a/license b/license
new file mode 100644
index 0000000..6faf3cf
--- /dev/null
+++ b/license
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 lonkaars
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..e548bf8
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,7 @@
+#include <cstdio>
+
+int main(int argc, char** argv) {
+ printf("hello world!\n");
+ return 0;
+}
+
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..41e74eb
--- /dev/null
+++ b/makefile
@@ -0,0 +1,8 @@
+# this makefile transparently forwards all `make` calls to `redo` for convenience
+
+.PHONY: FORCE
+
+all: FORCE
+ @redo $(MAKECMDGOALS)
+
+$(MAKECMDGOALS): all