diff --git a/Makefile b/Makefile index 4c1f1f4..e00528b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # ZeroMQ header file -CC=gcc -fPIC +CC=gcc -fPIC CFLAGS=-O3 -Wall -pedantic -g PREFIX=/usr/local/ @@ -9,22 +9,22 @@ PREFIX=/usr/local/ default: libf77zmq.so libf77zmq.a f77_zmq.h install: libf77zmq.so libf77zmq.a f77_zmq.h - install -D -m 644 libf77zmq.a $(PREFIX)/lib/ - install -D -m 644 libf77zmq.so $(PREFIX)/lib/ - install -D -m 644 f77_zmq.h $(PREFIX)/include/ - install -D -m 644 f77_zmq_free.h $(PREFIX)/include/ + install -D -m 644 libf77zmq.a $(PREFIX)/lib/ + install -D -m 644 libf77zmq.so $(PREFIX)/lib/ + install -D -m 644 f77_zmq.h $(PREFIX)/include/ + install -D -m 644 f77_zmq_free.h $(PREFIX)/include/ libf77zmq.so: f77_zmq.o $(CC) -shared $^ -o $@ -libf77zmq.a: f77_zmq.o +libf77zmq.a: f77_zmq.o $(AR) cr $@ $^ f77_zmq.o: f77_zmq.c f77_zmq.h $(CC) $(CFLAGS) -c f77_zmq.c -o $@ f77_zmq.h: create_f77_zmq_h.py f77_zmq.c - python3 create_f77_zmq_h.py + python create_f77_zmq_h.py clean: $(RM) -f -- f77_zmq.o f77_zmq.h diff --git a/create_f77_zmq_h.py b/create_f77_zmq_h.py index b9db9c0..c4c7d99 100755 --- a/create_f77_zmq_h.py +++ b/create_f77_zmq_h.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # # f77_zmq : Fortran 77 bindings for the ZeroMQ library # Copyright (C) 2014 Anthony Scemama @@ -24,12 +24,16 @@ # Universite Paul Sabatier - Bat. 3R1b4, 118 route de Narbonne # 31062 Toulouse Cedex 09, France +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function import re import os import sys import ctypes + def create_lines(f): result = f.read() result = result.replace('\\\n', '') @@ -121,7 +125,7 @@ def find_ZMQ_H(): v = os.environ.get("C_INCLUDE_PATH") if v is None: v = "/usr/include:/usr/local/include" - + for d in v.split(':'): if d and "zmq.h" in os.listdir(d): return ("{0}/zmq.h".format(d))