Added user-editable Config file. Add support for $(PREFIX).
authorDavid Schleef <ds@schleef.org>
Sun, 15 Jul 2001 23:15:29 +0000 (23:15 +0000)
committerDavid Schleef <ds@schleef.org>
Sun, 15 Jul 2001 23:15:29 +0000 (23:15 +0000)
Config [new file with mode: 0644]
Makefile

diff --git a/Config b/Config
new file mode 100644 (file)
index 0000000..47d794b
--- /dev/null
+++ b/Config
@@ -0,0 +1,40 @@
+#!/usr/bin/make
+
+#
+# If you want to cross-compile Comedilib, change CROSS to something
+# useful.
+#
+CROSS = 
+#CROSS = i386-uclibc-
+#CROSS = powerpc-linux-
+CC = $(CROSS)gcc
+AR = $(CROSS)ar
+LD = $(CROSS)ld
+
+
+# Optimization and debugging
+CFLAGS = -Wall -Wstrict-prototypes
+CFLAGS += -O2
+#CFLAGS += -g
+
+
+# Python wrapper:
+# If you want to build the python wrapper, change this to yes.
+with_python = no
+
+
+# Perl wrapper:
+# If you want to build the perl wrapper, change this to yes.
+with_perl = no
+
+
+# Installation:
+# PREFIX is the directory prefix where the library/headers/etc. will
+# reside.  Typically, this will be /usr or /usr/local.
+# DESTDIR is prepended to installation paths only during the install
+# phase, so you can install to a different directory than /.  Useful
+# for packaging.
+
+PREFIX = /usr
+#DESTDIR = $(TOPDIR)/_install
+
index 0ac279152a5ec6fe552c6193190c2872a00bfe47..6221b15c65b424bd881648ea5398cc5318cc751f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,14 @@
 
 # Makefile for comedi
 
-with_python = no
-with_perl = no
-
-.EXPORT_ALL_VARIABLES:
+TOPDIR=`pwd`
 
+include Config
 include version
-MAJOR=0
 
-CFLAGS = -Wall -O2
+.EXPORT_ALL_VARIABLES:
 
-CROSS   := 
-CC      := $(CROSS)gcc
-AR      := $(CROSS)ar
-LD      := $(CROSS)ld
-INSTALL := install
+MAJOR=0
 
 TARGETS = comedilib
 ifeq ($(with_python),yes)
@@ -31,19 +24,19 @@ SUBDIRS= lib demo comedi_calibrate testing comedi_config
 
 DOCFILES= README `find doc -type f`
 
-INSTALLDIR=$(DESTDIR)/usr
-INSTALLDIR_LIB=$(DESTDIR)/usr/lib
+INSTALLDIR=$(DESTDIR)$(PREFIX)
+INSTALLDIR_LIB=$(DESTDIR)$(PREFIX)/lib
 ifneq ($(DEB_BUILD_ARCH),)
-INSTALLDIR_DOC=$(DESTDIR)/usr/share/doc/libcomedi
-INSTALLDIR_MAN=$(DESTDIR)/usr/share/man
-INSTALLDIR_PERL=$(DESTDIR)/usr/lib/perl5/
+INSTALLDIR_DOC=$(DESTDIR)$(PREFIX)/share/doc/libcomedi
+INSTALLDIR_MAN=$(DESTDIR)$(PREFIX)/share/man
+INSTALLDIR_PERL=$(DESTDIR)$(PREFIX)/lib/perl5/
 else
-INSTALLDIR_DOC=$(DESTDIR)/usr/doc/libcomedi
-INSTALLDIR_MAN=$(DESTDIR)/usr/man
-INSTALLDIR_PERL=$(DESTDIR)/usr/lib/perl/
+INSTALLDIR_DOC=$(DESTDIR)$(PREFIX)/doc/libcomedi
+INSTALLDIR_MAN=$(DESTDIR)$(PREFIX)/man
+INSTALLDIR_PERL=$(DESTDIR)$(PREFIX)/lib/perl/
 endif
-INSTALLDIR_BIN=$(DESTDIR)/usr/bin
-INSTALLDIR_SBIN=$(DESTDIR)/usr/sbin
+INSTALLDIR_BIN=$(DESTDIR)$(PREFIX)/bin
+INSTALLDIR_SBIN=$(DESTDIR)$(PREFIX)/sbin
 
 comedilib:     subdirs