Add mkdir
This commit is contained in:
parent
157505ad6a
commit
ef7be623a9
|
@ -1,6 +1,4 @@
|
|||
*
|
||||
!.gitignore
|
||||
!cat.c
|
||||
!touch.c
|
||||
!yes.c
|
||||
!*.c
|
||||
!Makefile
|
||||
|
|
18
src/Makefile
18
src/Makefile
|
@ -1,13 +1,15 @@
|
|||
CC= gcc
|
||||
SRCFILES= cat.c touch.c yes.c mkdir.c
|
||||
OBJFILES= cat touch yes mkdir
|
||||
CFLAGS= -Wall -Wextra
|
||||
LFLAGS=
|
||||
|
||||
all: cat touch yes
|
||||
.PHONY: all clean
|
||||
|
||||
main: $(OBJFILES)
|
||||
$(CC) cat.c -o cat
|
||||
$(CC) touch.c -o touch
|
||||
$(CC) yes.c -o yes
|
||||
all:
|
||||
$(CC) $(CFLAGS) cat.c -o cat
|
||||
$(CC) $(CFLAGS) touch.c -o touch
|
||||
$(CC) $(CFLAGS) yes.c -o yes
|
||||
$(CC) $(CFLAGS) mkdir.c -o mkdir
|
||||
|
||||
test: main
|
||||
./cat ../tests/test.txt
|
||||
clean:
|
||||
@rm ${OBJFILES}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
mode_t mode = 0755;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
mkdir(argv[i], mode);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue