Added user-editable Config file. Add support for $(PREFIX).

This commit is contained in:
David Schleef 2001-07-15 23:15:29 +00:00
parent f4f16b883d
commit 5671f6d9d0
2 changed files with 54 additions and 21 deletions

40
Config Normal file
View file

@ -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

View file

@ -1,22 +1,15 @@
# Makefile for comedi
with_python = no
with_perl = no
TOPDIR=`pwd`
include Config
include version
.EXPORT_ALL_VARIABLES:
include version
MAJOR=0
CFLAGS = -Wall -O2
CROSS :=
CC := $(CROSS)gcc
AR := $(CROSS)ar
LD := $(CROSS)ld
INSTALL := install
TARGETS = comedilib
ifeq ($(with_python),yes)
TARGETS += python
@ -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