Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
80e27dd6
Commit
80e27dd6
authored
5 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
changing makefile
parent
65ac4ee9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+40
-20
40 additions, 20 deletions
Makefile
old_makefile
+0
-35
0 additions, 35 deletions
old_makefile
with
40 additions
and
55 deletions
Makefile
+
40
−
20
View file @
80e27dd6
...
...
@@ -6,29 +6,49 @@ ifeq ($(BINARY_C),)
$(
error
BINARY_C is not
set
)
endif
CC
:=
gcc
LD
:=
gcc
# Name of program
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
# some commands
CC
:=
gcc
LD
:=
gcc
MAKE
:=
/usr/bin/make
# Libraries
LIBS
:=
-lbinary_c
$(
shell
$(
BINARY_C
)
/binary_c-config
--libs
)
# 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
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
)
PY_EXEC
:=
python3
PY_SETUP
:=
setup.py
PY_OPTIONS
:=
build_ext
--inplace
all
:
$(
CC
)
-DBINARY_C
=
$(
BINARY_C
)
$(
CFLAGS
)
$(
INCDIRS
)
$(
C_SRC
)
$(
OBJ_FLAGS
)
$(
LIBS
)
#
$(
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
:
rm
-f
*
.o
*
.so
...
...
This diff is collapsed.
Click to expand it.
old_makefile
deleted
100644 → 0
+
0
−
35
View file @
65ac4ee9
# 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/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment