Makefile

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.2 kB
2
Indexable
Never
CC = gcc
CFLAGS = -Wall -g

all: mytar

mytar: mytar.c extract.o read.o create.o list.o options.o header.o write.o
        $(CC) -o mytar $(CFLAGS) extract.o read.o list.o options.o header.o write.o create.o mytar.c

create.o: create.c create.h
        $(CC) -c $(CFLAGS) create.c create.h

options.o: options.c options.h
        $(CC) -c $(CFLAGS) options.c options.h

header.o: header.c header.h
        $(CC) -c $(CFLAGS) header.c header.h

write.o: write.c write.h
        $(CC) -c $(CFLAGS) write.c write.h

read.o: read.c read.h
        $(CC) -c $(CFLAGS) read.c read.h

list.o: list.c list.h
        $(CC) -c $(CFLAGS) list.c list.h

extract.o: extract.c extract.h
        $(CC) -c $(CFLAGS) extract.c extract.h

testCreate: mytar
        ./mytar cvf test testfile

testVal: mytar
        valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./mytar cvf test testfile

testValDir: mytar
        valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./mytar cvf test TestDir

clean:
        rm extract.h.gch extract.o read.h.gch list.h.gch list.o read.o test header.o mytar create.o options.o write.o write.h.gch create.h.gch options.h.gch header.h.gch
Leave a Comment