Subversion Repositories svn.Prod repos

Rev

Rev 38 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 - 1
PRG=filefind
2
SRC=$(PRG).c
53 - 3
DIR=/var/tmp/filefind_testdata
34 - 4
.PHONY: clean test cleantest
2 ls 5
 
38 - 6
all: test
7
 
33 - 8
$(PRG): checkfiles.h $(SRC)
36 - 9
	@echo "INFO: Building $@ from $^"
2 ls 10
	$(CC) $@.c -o $@
11
 
33 - 12
clean:
13
	rm -f $(PRG)
2 ls 14
 
53 - 15
createtestdata:
16
	mkdir -p $(DIR)
17
	echo "bla" > $(DIR)/testfile
18
 
19
test: createtestdata $(PRG)
33 - 20
	./$(PRG) $(DIR)	> result
21
	sort result	> result.sort
22
	find $(DIR)	> result2
23
	sort result2	> result2.sort
26 - 24
	wc *.sort
25
	diff *.sort
25 - 26
 
33 - 27
cleantest:
28
	rm -f result	result.sort
29
	rm -f result2	result2.sort
53 - 30
	rm -rf $(DIR)