| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | ################################################################
 | 
					
						
							|  |  |  | # YAP/SWI-Prolog R interface package
 | 
					
						
							|  |  |  | # Author:    Nicos Angelopoulos
 | 
					
						
							|  |  |  | # Copyright: Perl License
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-02 22:37:27 +00:00
										 |  |  | PACKAGE=python | 
					
						
							|  |  |  | DOC=python | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | PKGCFLAGS=@PYTHON_INCLUDES@ | 
					
						
							|  |  |  | include ../Makefile.defs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | OBJS=		python.o | 
					
						
							|  |  |  | SOLIBS=		python.@SO@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LIBPL=		python.pl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | all:		@PYTHON_TARGET@ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-02 22:37:27 +00:00
										 |  |  | pitf:		$(SOLIBS) | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | dummy:: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | python.@SO@:	$(OBJS) | 
					
						
							|  |  |  | 		$(LD) $(LDSOFLAGS) -o $@ $(OBJS) $(LIBS) @PYTHON_LIBS@ $(LIBPLSO) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install:	install-@PYTHON_TARGET@ | 
					
						
							|  |  |  | install-dummy:: | 
					
						
							| 
									
										
										
										
											2014-02-13 01:58:48 +00:00
										 |  |  | install-pitf:	$(SOLIBS) $(addprefix $(srcdir)/, $(LIBPL)) install-examples | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | 		mkdir -p $(DESTDIR)$(SOLIBDIR) | 
					
						
							|  |  |  | 		rm -f $(DESTDIR)$(SOLIBDIR)/python.@SO@ | 
					
						
							| 
									
										
										
										
											2014-06-04 22:08:37 +01:00
										 |  |  | 		$(INSTALL_PROGRAM) $(SOLIBS) $(DESTDIR)$(SOLIBDIR) | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | 		mkdir -p $(DESTDIR)$(PLLIBDIR) | 
					
						
							|  |  |  | 		for f in $(LIBPL); do \
 | 
					
						
							|  |  |  | 		  $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(PLLIBDIR); \
 | 
					
						
							|  |  |  | 		done | 
					
						
							|  |  |  | 		$(MKINDEX) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ln-install:: | 
					
						
							|  |  |  | 		$(MAKE) INSTALL_DATA="../ln-install" INSTALL_PROGRAM="../ln-install" install | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | rpm-install:	install | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | html-install:: | 
					
						
							|  |  |  | 		mkdir -p $(DESTDIR)$(PKGDOC) | 
					
						
							|  |  |  | 		$(INSTALL) -m 644 $(DOC).html $(DESTDIR)$(PKGDOC) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pdf-install:: | 
					
						
							|  |  |  | 		mkdir -p $(DESTDIR)$(PKGDOC) | 
					
						
							|  |  |  | 		$(INSTALL) -m 644 $(DOC).pdf $(DESTDIR)$(PKGDOC) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | uninstall:: | 
					
						
							|  |  |  | 		(cd $(SOLIBDIR) && rm -f $(TARGETS)) | 
					
						
							|  |  |  | 		(cd $(PLBASE)/library && rm -f $(LIBPL)) | 
					
						
							|  |  |  | 		$(MKINDEX) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-13 01:58:48 +00:00
										 |  |  | install-examples:: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | ################################################################
 | 
					
						
							|  |  |  | # Documentation
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEXEXTRA=	libpython.tex | 
					
						
							|  |  |  | $(TEX):		$(TEXEXTRA) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | libpython.tex:	python.pl | 
					
						
							|  |  |  | 		$(PLTOTEX) --section 'library(python)' --out=$@ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							|  |  |  | # Testing
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | check:: | 
					
						
							|  |  |  | 		(cd $(srcdir) && $(PL) -q -f test_python.pl -g test_python,halt -t 'halt(1)' ) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples; python create_term.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples; python knowledgebase.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples; python knowledgebase.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples; python register_foreign.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples; python register_foreign_simple.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/coins; python coins.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/draughts; python puzzle1.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/hanoi; python hanoi.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/sendmoremoney; python money.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/sudoku; python sudoku.py) | 
					
						
							|  |  |  | 		(cd $(srcdir)/examples/sudoku; python sudoku_daily.py) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							|  |  |  | # Clean
 | 
					
						
							|  |  |  | ################################################################
 | 
					
						
							| 
									
										
										
										
											2010-06-01 00:33:32 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | clean: | 
					
						
							| 
									
										
										
										
											2012-10-08 23:58:22 +01:00
										 |  |  | 		rm -f $(SOLIBS) *~ *.o *% a.out core config.log | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | distclean:	clean | 
					
						
							|  |  |  | 		rm -f $(TARGETS) config.cache config.h config.status Makefile | 
					
						
							|  |  |  | 		rm -f $(DOC).aux $(DOC).log $(DOC).out $(DOC).toc | 
					
						
							|  |  |  | 		rm -rf html | 
					
						
							|  |  |  | 		rm -rf autom4te.cache | 
					
						
							| 
									
										
										
										
											2010-06-01 00:33:32 +01:00
										 |  |  | 
 |