aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.rules
blob: 99c9cce1bc03b62b60253a74b0f86802934e36e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- makefile -*-
# $Id$
#
# Makefile rules for autofs project
#

# Root directory contents
SUBDIRS = daemon modules man
INCDIRS = include samples
INCFILES = COPYING COPYRIGHT NEWS README TODO Makefile Makefile.rules \
	   Makefile.conf.in .version .autofs-* configure.in aclocal.m4 \
	   configure

# Compilers, linkers and flags
# The STRIP defined here *must not* remove any dynamic-loading symbols

ifdef DEBUG
CFLAGS    = -O2 -g -DDEBUG
LDFLAGS   = -g
STRIP     = :
else
CFLAGS    = -O3 -fomit-frame-pointer -Wall
LDFLAGS   = -s
STRIP     = strip --strip-debug
endif

CC        = gcc
CXX       = g++
CXXFLAGS  = $(CFLAGS)
LD        = ld
SOLDFLAGS = -shared

# Kernel compilation rules (this is for "make kernel" to work; not needed
# if you're compiling the autofs kernel code as a part of the kernel itself.
# For "make kernel" to work you need the kernel code to be in the "kernel"
# directory; not included with the autofs distribution.)

# 1. Comment this out if your kernel is *not* SMP
KFLAGS   = -D__SMP__
# 2. Set this to your kernel include files
KINCLUDE = /usr/src/linux/include
# 3. Comment this out if you do *not* use versioned modules
MODFLAGS = -DMODVERSIONS -include $(KINCLUDE)/linux/modversions.h

# Directory to install modules
moddir = $(INSTALLROOT)/lib/modules/`uname -r`
fsmoddir = $(moddir)/fs

# Standard rules

.SUFFIXES: .c .o .s .so

.c.o:
	$(CC) $(CFLAGS) -c $<

.c.s:
	$(CC) $(CFLAGS) -S $<

.c.so:
	$(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $<
	$(STRIP) $*.so