summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile20
-rw-r--r--argv.c9
3 files changed, 30 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7c1a509
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+argv
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1c082ed
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+PREFIX ?= /usr/local
+BINDIR ?= /bin
+
+CFLAGS = -O3 -static -s
+
+all: argv
+
+argv: argv.c
+
+install:
+ install -m755 argv -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
+
+uninstall:
+ rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)/argv"
+
+clean:
+ rm -f argv
+
+.PHONY: all clean install uninstall
+
diff --git a/argv.c b/argv.c
new file mode 100644
index 0000000..459f2ed
--- /dev/null
+++ b/argv.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main(int argc, const char **argv)
+{
+ for (int i = 0; i < argc; i++) {
+ puts(argv[i]);
+ }
+}