- Is this a proper way to design multiple implementations of a single interface? 2)---------------------
- removed
- If there are obvious bugs or "it works, but please don't do it that way" things, please point them out.
CC=gcc
CFLAGS=-g3 -Wall
all:
test: test_linked_list.out test_array_list.out
./test_linked_list.out
./test_array_list.out
@echo OK!
test_linked_list.out: test/test_list.o test/tester.o lists/linked_list.o
$(CC) $(CFLAGS) -o $@ $^
test_array_list.out: test/test_list.o test/tester.o lists/array_list.o
$(CC) $(CFLAGS) -o $@ $^
test/test_list.o: test/tester.h lists/list.h
perftest: profile_array_list profile_linked_list
@echo LinkedList:
./profile_linked_list
@echo ArrayList:
./profile_array_list
profile_array_list.out: profile_list.o lists/array_list.o
$(CC) $(CFLAGS) -o $@ $^
profile_linked_list.out: profile_list.o lists/linked_list.o
$(CC) $(CFLAGS) -o $@ $^
tester.o: test/tester.h
linked_list.o: lists/list.h
array_list.o: lists/list.h
clean:
rm -f *.o test/*.o lists/*.o *.out
```
Edits:
- Removed question 2) since it is not suited for this community