blob: f2ba38659b3dfb8cce05ae53e48c65cb6ff41166 [file] [log] [blame]
#
# Makefile rules for autofs project
#
# Root directory contents
SUBDIRS = lib daemon modules man samples
INCDIRS = include
INCFILES = COPYING COPYRIGHT NEWS README* TODO Makefile Makefile.rules \
Makefile.conf.in .version .autofs-* configure.in aclocal.m4 \
configure *.patch autofs.spec
# Attempt to be friends with autotools
INSTALLROOT = $(DESTDIR)
# autofs utility library
AUTOFS_LIB = ../lib/autofs.a
# Compilers, linkers and flags
# The STRIP defined here *must not* remove any dynamic-loading symbols
ifdef DMALLOCLIB
DEBUG=1
endif
ifdef DEBUG
CFLAGS ?= -g -Wall -DDEBUG
LDFLAGS = -g
STRIP = :
else
ifdef DONTSTRIP
CFLAGS ?= -O2 -g
LDFLAGS = -g
STRIP = :
else
CFLAGS ?= -O2 -Wall
LDFLAGS = -s
STRIP = strip --strip-debug
endif
endif
CC = gcc
CXX = g++
CXXFLAGS = $(CFLAGS)
LD = ld
SOLDFLAGS = -shared
CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
LDFLAGS += -lpthread
ifdef TIRPCLIB
CFLAGS += -I/usr/include/tirpc
LDFLAGS += $(TIRPCLIB)
endif
ifdef DMALLOCLIB
LDFLAGS += $(DMALLOCLIB)
endif
# Standard rules
.SUFFIXES: .c .o .s .so
.c.o:
$(CC) $(CFLAGS) -c $<
.c.s:
$(CC) $(CFLAGS) -S $<
.c.so:
$(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(DMALLOCLIB) $(LIBNSL)
$(STRIP) $*.so