-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMacMakefile
More file actions
39 lines (31 loc) · 984 Bytes
/
MacMakefile
File metadata and controls
39 lines (31 loc) · 984 Bytes
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
36
37
38
# SPDX-License-Identifier: MIT WITH bison-exception WITH swig-exception
# Copyright © 2020 Matthew Stern, Benjamin Michalowicz
CC=gcc
BIN=topylogic
SRC=$(wildcard src/*.c)
INCLUDES= $(wildcard include/*.h)
OBJ=$(SRC:.c=.o)
LDFLAGS= -lm -lpthread -L. -ltopologic -pthread
CFLAGS= -Wall -Werror -g -fPIC -O2 `pkg-config --cflags python3` #-DDEBUG
PYFLAGS= `pkg-config --cflags python3`
TOPYLOGIC_I=pysrc/topylogic.i
TOPYLOGIC_WRAP=pysrc/topylogic_wrap.c
TOPYLOGIC_A=pysrc/_topylogic.a
TOPYLOGIC_PY=pysrc/topylogic.py
TOPYLOGIC_O=pysrc/topylogic_wrap.o
$(BIN): $(OBJ) $(INCLUDES)
swig -python -keyword $(TOPYLOGIC_I)
$(CC) -c -fPIC $(TOPYLOGIC_WRAP) -o $(TOPYLOGIC_O) $(PYFLAGS)
$(AR) rcs $(TOPYLOGIC_A) $(OBJ) $(TOPYLOGIC_O)
all:$(BIN)
.PHONY : clean python
clean:
rm -rf pysrc/__pycache__
rm -rf pysrc/build
-rm -f $(OBJ)
-rm -f $(TOPYLOGIC_PY)
-rm -f $(TOPYLOGIC_A)
-rm -f $(TOPYLOGIC_O)
-rm -f $(TOPYLOGIC_WRAP)
-rm -f pysrc/state_*
-rm -f pysrc/*.pyc