Added missing homework 8 and 9
This commit is contained in:
parent
59dd4ecc7d
commit
25adb24a16
15 changed files with 1625 additions and 0 deletions
72
homework08/Makefile
Normal file
72
homework08/Makefile
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
CC= gcc
|
||||
CFLAGS= -Wall -g -std=gnu99
|
||||
LD= gcc
|
||||
LDFLAGS= -L.
|
||||
TARGETS= findit
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# TODO: Add rules for object files
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
list.o: list.c
|
||||
$(CC) $(CFLAGS) -c -o list.o list.c
|
||||
|
||||
filter.o: filter.c
|
||||
$(CC) $(CFLAGS) -c -o filter.o filter.c
|
||||
|
||||
findit.o: findit.c findit.h
|
||||
$(CC) $(CFLAGS) -c -o findit.o findit.c
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# TODO: Add rules for executables
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
findit: findit.o filter.o list.o
|
||||
$(LD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# DO NOT MODIFY BELOW
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
test:
|
||||
@$(MAKE) -sk test-all
|
||||
|
||||
test-all: test-gitignore test-list test-filter test-findit
|
||||
|
||||
test-gitignore:
|
||||
@echo "findit" > .gitignore
|
||||
@echo "*.o" >> .gitignore
|
||||
@echo "*.sh" >> .gitignore
|
||||
@echo "*.unit" >> .gitignore
|
||||
|
||||
test-list: list.unit
|
||||
@curl -sLO https://www3.nd.edu/~pbui/teaching/cse.20289.sp25/static/txt/homework08/list.unit.sh
|
||||
@chmod +x list.unit.sh
|
||||
@./list.unit.sh
|
||||
|
||||
list.unit.o: list.unit.c findit.h
|
||||
@$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
list.unit: list.unit.o list.o
|
||||
@$(LD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
test-filter: filter.unit
|
||||
@curl -sLO https://www3.nd.edu/~pbui/teaching/cse.20289.sp25/static/txt/homework08/filter.unit.sh
|
||||
@chmod +x filter.unit.sh
|
||||
@./filter.unit.sh
|
||||
|
||||
filter.unit.o: filter.unit.c findit.h
|
||||
@$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
filter.unit: filter.unit.o filter.o
|
||||
@$(LD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
test-findit: findit
|
||||
@curl -sLO https://www3.nd.edu/~pbui/teaching/cse.20289.sp25/static/txt/homework08/findit.test.sh
|
||||
@chmod +x findit.test.sh
|
||||
@./findit.test.sh
|
||||
|
||||
clean:
|
||||
@rm -f *.o *.sh *.unit findit
|
||||
Loading…
Reference in a new issue