diff options
| author | leiyu3 <s444814187@gmail.com> | 2022-09-22 09:39:20 -0400 |
|---|---|---|
| committer | leiyu3 <s444814187@gmail.com> | 2022-09-22 09:39:20 -0400 |
| commit | 29db4e615e4bfdf6ec107e5cdd1547403eb2a6e4 (patch) | |
| tree | ce5484c8718303e6b6f5afbfe65d4dbce3d95f50 /Makefile | |
| parent | 6937d11bd38ff67522330b316c5720c313dc5ee1 (diff) | |
| download | vector_c-29db4e615e4bfdf6ec107e5cdd1547403eb2a6e4.tar.gz vector_c-29db4e615e4bfdf6ec107e5cdd1547403eb2a6e4.zip | |
change to static library
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 16 |
1 files changed, 14 insertions, 2 deletions
| @@ -1,5 +1,17 @@ | |||
| 1 | CC=clang | 1 | CC=clang |
| 2 | CFLAGS=-Wall -g | ||
| 2 | 3 | ||
| 4 | BINS = vector.o libvector.a main test | ||
| 5 | all: $(BINS) | ||
| 3 | 6 | ||
| 4 | main: main.c | 7 | vector.o: vector.h libvector.c |
| 5 | gcc main.c -o main | 8 | $(CC) $(CFLAGS) -c libvector.c |
| 9 | |||
| 10 | libvector.a: libvector.o | ||
| 11 | ar -cvq libvector.a libvector.o | ||
| 12 | |||
| 13 | main: main.c libvector.a | ||
| 14 | $(CC) $(CFLAGS) -o $@ $^ | ||
| 15 | |||
| 16 | test: test.c | ||
| 17 | gcc test.c -o test -lcriterion | ||
