Skip to main content
Became Hot Network Question
added 63 characters in body
Source Link
  1. Is this a proper way to design multiple implementations of a single interface? 2)---------------------
  2. removed
  3. 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:

  1. Removed question 2) since it is not suited for this community
  1. Is this a proper way to design multiple implementations of a single interface? 2)---------------------
  2. 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
```
  1. Is this a proper way to design multiple implementations of a single interface?
  2. removed
  3. 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:

  1. Removed question 2) since it is not suited for this community
- removed question not suited to this community
Source Link
  1. Is this a proper way to design multiple implementations of a single interface? 2)---------------------
  2. 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 not suited to this community

  1. Is this a proper way to design multiple implementations of a single interface?
  2. 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 not suited to this community

  1. Is this a proper way to design multiple implementations of a single interface? 2)---------------------
  2. 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
```
deleted 32 characters in body
Source Link
  1. Is this a proper way to design multiple implementations of a single interface?
  2. How could this be extended so different list implementations can be used in a single file?
  3. 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 not suited to this community

  1. Is this a proper way to design multiple implementations of a single interface?
  2. How could this be extended so different list implementations can be used in a single file?
  3. 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
```
  1. Is this a proper way to design multiple implementations of a single interface?
  2. 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 not suited to this community

Source Link
Loading