diff options
| author | Louis Burda <quent.burda@gmail.com> | 2024-10-29 14:23:53 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2024-10-29 14:23:53 +0100 |
| commit | ce293e91689cd4e5c1992a2ec051bcf70134c6ef (patch) | |
| tree | 984a33773bb6a1c3beee4183665ccc63c7970db1 | |
| download | argv-ce293e91689cd4e5c1992a2ec051bcf70134c6ef.tar.gz argv-ce293e91689cd4e5c1992a2ec051bcf70134c6ef.zip | |
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 20 | ||||
| -rw-r--r-- | argv.c | 9 |
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 + @@ -0,0 +1,9 @@ +#include <stdio.h> + +int +main(int argc, const char **argv) +{ + for (int i = 0; i < argc; i++) { + puts(argv[i]); + } +} |
