/[ascend]/trunk/models/johnpye/extfn/Makefile
ViewVC logotype

Contents of /trunk/models/johnpye/extfn/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 381 - (show annotations) (download)
Sun Mar 19 23:01:39 2006 UTC (18 years, 3 months ago) by johnpye
File size: 1530 byte(s)
Fixing 'auto package registration' with 'libstemname_register'.
Fixed bug #247.
1 # Makefile for add-ins in the current directory; for each .c file you will get a separate .so file.
2
3 PACKAGES = extfntest
4
5 ASCEND_BASE_REL = ../../..
6
7 ASCEND_BASE = $(shell cd $(ASCEND_BASE_REL) && pwd)
8
9 ASCEND_INCDIR = $(ASCEND_BASE)/base/generic
10
11 LIBS = $(PACKAGES:%=$(SO_PREF)%$(SO_SUF))
12
13 ifeq ($(OSTYPE),msys)
14 PYTHON_VERSION := 24
15 PYTHON_ROOT := /c/Python$(PYTHON_VERSION)
16 PYTHON_CPPFLAGS := -I$(PYTHON_ROOT)/include
17 PYTHON_LDFLAGS := -L$(PYTHON_ROOT)/libs -lpython$(PYTHON_VERSION)
18 SO_SUF = .dll
19 SO_PREF =
20 else
21 ifeq ($(TERM),cygwin)
22 PYTHON_VERSION := 24
23 PYTHON_ROOT := /cygdrive/c/Python$(PYTHON_VERSION)
24 PYTHON_CPPFLAGS := -I$(PYTHON_ROOT)/include
25 PYTHON_LDFLAGS := -L$(PYTHON_ROOT)/libs -lpython24
26 SO_SUF = .dll
27 SO_PREF =
28 else
29 PYTHON_VERSION := $(shell python -V 2>&1 | sed s/Python\ // | sed s/^\\\([0-9][0-9]*\\.[0-9][0-9]*\\\).*/\\1/ )
30 PYTHON_CPPFLAGS := -I/usr/include/python$(PYTHON_VERSION)
31 PYTHON_LDFLAGS := -lpython$(PYTHON_VERSION)
32 SO_SUF = .so
33 SO_PREF = lib
34 endif
35 endif
36
37 all: ascend makelibs test
38
39 makelibs: $(LIBS)
40 @echo "Compiled libraries $(LIBS)"
41
42 test: $(LIBS)
43 PYTHONPATH=$(ASCEND_BASE)/pygtk/interface/ $(PYTHON_ROOT)/python extfntest.py
44
45 ascend:
46 make -j2 -C $(ASCEND_BASE)/pygtk/interface/
47
48 CC = gcc
49
50 LD = libtool --mode=link $(CC) -module -shared
51
52 LDFLAGS = -lm -Wl,-no-undefined
53
54 CPPFLAGS = -I$(ASCEND_INCDIR)
55 CFLAGS = -O -c
56
57 $(SO_PREF)%$(SO_SUF): %.o
58 $(LD) -o $@ $^ $(LDFLAGS)
59
60 %.lo: %.c
61 libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $^
62
63 clean:
64 -rm *.o *.so

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22