slash

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit e1b1d240acc5248539c2d0139bfa4fb0d8b2f22a
Author: Mario Rosell R. Martinez <mario@mariorosell.es>
Date:   Fri,  3 Apr 2026 14:43:40 +0200

Initial commit

Diffstat:
AMakefile | 40++++++++++++++++++++++++++++++++++++++++
Aslash.c | 18++++++++++++++++++
2 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,40 @@ +# +# Makefile -- build system +# + +SRCS := slash.c cli.c stat.c +OBJS := ${SRCS:.c=.o} + +CC ?= cc +CFLAGS := -Wall -Werror -pipe -std=c99 +CPPFLAGS := -DVERSION='"0.1.0 DEV"' -DIN_SLASH +LDFLAGS ?= +LIBS ?= -lm + +TARG ?= slash + +DESTDIR ?= / +BINDIR ?= usr/local/bin + +.SUFFIXES: .c .o + +.c.o: + ${CC} ${CFLAGS} ${CPPFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +all: ${TARG} + +${TARG}: ${OBJS} + ${CC} ${OBJS} -o ${TARG} ${LDFLAGS} ${LIBS} + +clean: + rm -f ${TARG} ${OBJS} + +install: all + install -d ${DESTDIR}${BINDIR} + install -m 755 ${TARG} ${DESTDIR}${BINDIR} + +uninstall: + rm -f ${DESTDIR}${BINDIR}/${TARG} + +.PHONY: all clean install uninstall + diff --git a/slash.c b/slash.c @@ -0,0 +1,18 @@ +/* + * slash.c -- main + */ + +#include <stdio.h> +#include <stdlib.h> + +#include "cli.h" +#include "stat.h" + +int +main(int argc, char** argv) +{ + cli(argc, argv); + + return EXIT_SUCCESS; +} +