Skip to content
Snippets Groups Projects
Commit 80e27dd6 authored by David Hendriks's avatar David Hendriks
Browse files

changing makefile

parent 65ac4ee9
No related branches found
No related tags found
No related merge requests found
...@@ -6,29 +6,49 @@ ifeq ($(BINARY_C),) ...@@ -6,29 +6,49 @@ ifeq ($(BINARY_C),)
$(error BINARY_C is not set) $(error BINARY_C is not set)
endif endif
# Name of program
CC := gcc
LD := gcc
PROGRAM := binary_c_python_api PROGRAM := binary_c_python_api
MAKE := /usr/bin/make
LIBS := -lbinary_c $(shell $(BINARY_C)/binary_c-config --libs) # some commands
#`$(BINARY_C)/binary_c-config --libdirs_list` CC := gcc
C_SRC := binary_c_python_api.c LD := gcc
OBJECTS := $(C_SRC:.c=.o) MAKE := /usr/bin/make
OBJ_FLAGS := -c
CFLAGS := -fPIC $(shell $(BINARY_C)/binary_c-config --flags | sed s/-fvisibility=hidden// ) -I$(BINARY_C)/src/ -I$(BINARY_C)/src/API # Libraries
SO_FLAGS := -shared -o LIBS := -lbinary_c $(shell $(BINARY_C)/binary_c-config --libs)
SO_NAME := libbinary_c_api.so
# Source files and cflags
C_SRC := binary_c_python_api.c
CFLAGS := -fPIC $(shell $(BINARY_C)/binary_c-config --flags | sed s/-fvisibility=hidden// )
# Incdirs
INCDIRS := -I$(BINARY_C)/src/ -I$(BINARY_C)/src/API
# Object files and flags
OBJECTS := $(C_SRC:.c=.o)
OBJ_FLAGS := -c
# Shared lib files and flags
SO_NAME := libbinary_c_api.so
SO_FLAGS := -shared -o
# To create python shared library # To create python shared library
PY_EXEC := python3 PY_EXEC := python3
PY_SETUP := setup.py PY_SETUP := setup.py
PY_OPTIONS := build_ext --inplace PY_OPTIONS := build_ext --inplace
all: $(OBJECTS)
$(CC) -DBINARY_C=$(BINARY_C) $(CFLAGS) $(INCDIRS) $(C_SRC) $(OBJ_FLAGS) $(INCDIRS) $(LIBS) all:
$(CC) -DBINARY_C=$(BINARY_C) $(SO_FLAGS) $(SO_NAME) $(OBJECTS) $(CC) -DBINARY_C=$(BINARY_C) $(CFLAGS) $(INCDIRS) $(C_SRC) $(OBJ_FLAGS) $(LIBS)
$(PY_EXEC) $(PY_SETUP) $(PY_OPTIONS) #$(CC) -DBINARY_C=$(BINARY_C) $(SO_FLAGS) $(SO_NAME) $(OBJECTS)
#$(PY_EXEC) $(PY_SETUP) $(PY_OPTIONS)
test:
@echo Objects: $(OBJECTS)
@echo Libs: $(LIBS)
@echo C_SRC: $(C_SRC)
@echo CFLAGS: $(CFLAGS)
@echo INCDIRS: $(INCDIRS)
clean: clean:
rm -f *.o *.so rm -f *.o *.so
......
# 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 $(shell $(BINARY_C)/binary_c-config --libs)
#`$(BINARY_C)/binary_c-config --libdirs_list`
C_SRC := binary_c_python_api.c
OBJECTS := $(C_SRC:.c=.o)
OBJ_FLAGS := -c
CFLAGS := -fPIC $(shell $(BINARY_C)/binary_c-config --flags | sed s/-fvisibility=hidden// ) -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
rm -rf build/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment