1
0

get simexec(1) building again

This commit is contained in:
dtb 2022-06-14 17:34:17 -04:00
parent 12d2cef2d4
commit 6004d654ea
4 changed files with 10 additions and 4 deletions

View File

@ -89,8 +89,11 @@ roll: libio sysexits roll.o
runlength: sysexits src/runlength.c usefulmacros runlength: sysexits src/runlength.c usefulmacros
$(CC) $(CFLAGS) -o bin/runlength src/runlength.c $(CC) $(CFLAGS) -o bin/runlength src/runlength.c
simexec: sysexits src/simexec.c usefulmacros simexec.o: libio sysexits src/simexec.c
$(CC) $(CFLAGS) -o bin/simexec src/simexec.c $(CC) $(CFLAGS) -c -o build/simexec.o src/simexec.c
simexec: libio simexec.o
$(CC) $(CFLAGS) -o bin/simexec build/libio.o build/simexec.o
streq: sysexits src/streq.c usefulmacros streq: sysexits src/streq.c usefulmacros
$(CC) $(CFLAGS) -o bin/streq src/streq.c $(CC) $(CFLAGS) -o bin/streq src/streq.c

View File

@ -1,5 +1,6 @@
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include "libio.h"
static int static int
_strlen(char *s){ _strlen(char *s){
@ -50,6 +51,8 @@ put: while(s > 0){
if((s /= 10) == 0) if((s /= 10) == 0)
r += write1(1, '\n'); r += write1(1, '\n');
} }
return r;
} }
int int

View File

@ -3,5 +3,5 @@
int fdprint(int fd, char *s); int fdprint(int fd, char *s);
int fdputd(int fd, int d); int fdputd(int fd, int d);
int fdputs(int fd, char *s); int fdputs(int fd, char *s);
int parse_uint(char *s); unsigned int parse_uint(char *s);
#endif /* ifndef _LIBIO_H */ #endif /* ifndef _LIBIO_H */

View File

@ -12,7 +12,7 @@ int main(int argc, char *argv[]){
if(argv[0] == NULL) if(argv[0] == NULL)
argv[0] = program_name; argv[0] = program_name;
fdprint(2, argv[0]); fdprint(2, argv[0]);
write(2, " [pathname], [argv...]\n", 23); write(2, " [pathname] [argv...]\n", 22);
return EX_USAGE; return EX_USAGE;
} }