-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (26 loc) · 792 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# SPDX-License-Identifier: MIT WITH bison-exception WITH swig-exception
# Copyright © 2020 Matthew Stern, Benjamin Michalowicz
CC=gcc
MCS=$(MCS)
LDFLAGS= -lm -lpthread -L. -ltopologic -pthread #-lfl
CFLAGS=-Wall -Werror -g -fPIC -O2 #-fsanitize=thread
OBJ=$(SRC:.c=.o)
AR=ar
BIN=topologic
SRC=$(wildcard src/*.c)
INCLUDES= $(wildcard include/*.h)
TESTS=$(TEST_SRC:.c=)#ADD MORE AS THEY GO
TEST_SRC=$(wildcard testing/*.c) #ADD MORE IF NEED BE
TEST_OBJ=$(TEST_SRC:.c=.o)
TEST_DIR=testing
all: $(BIN) $(TESTS)
$(BIN): $(OBJ) $(INCLUDES)
$(AR) rcs libtopologic.a $(OBJ)
$(TESTS): $(BIN) $(OBJ) $(TEST_OBJ)
$(CC) $(CFLAGS) -o $@ libtopologic.a $(TEST_DIR)/$(@F).o $(LDFLAGS)
all:$(BIN)
.PHONY : clean
clean:
rm -f libtopologic.a
rm -f $(TEST_OBJ) $(TESTS)
rm -f $(OBJ) $(BIN)