Skip to content
Snippets Groups Projects
Makefile 956 B
Newer Older
# Makefile for Rapid Binary Star Evolution program

# you will need to set the BINARY_C variable to point
# to the root binary_c directory
ifeq ($(BINARY_C),)
  $(error BINARY_C is not set)
endif


CC      := gcc
LD      := gcc
PROGRAM := binary_c_python_api
MAKE    := /usr/bin/make
LIBS 	:= -lbinary_c `$(BINARY_C)/binary_c-config --libs` 
C_SRC   := binary_c_python_api.c
OBJECTS := $(C_SRC:.c=.o)
OBJ_FLAGS := -c
CFLAGS := -fPIC `$(BINARY_C)/binary_c-config --flags` -I$(BINARY_C)/src/ -I$(BINARY_C)/src/API 
SO_FLAGS := -shared -o
SO_NAME := libbinary_c_api.so

# To create python shared library
PY_EXEC := python3
PY_SETUP := setup.py
PY_OPTIONS := build_ext --inplace

all: $(OBJECTS)
	$(CC) -DBINARY_C=$(BINARY_C) $(CFLAGS) $(INCDIRS) $(C_SRC) $(OBJ_FLAGS) $(INCDIRS) $(LIBS) 
	$(CC) -DBINARY_C=$(BINARY_C) $(SO_FLAGS) $(SO_NAME) $(OBJECTS)
	$(PY_EXEC) $(PY_SETUP) $(PY_OPTIONS) 

clean:
	rm -f *.o *.so
David Hendriks's avatar
David Hendriks committed
	find build/ -type f -delete
	rmdir build/*