7 VLOCK_VERSION
= 2.3-alpha1
9 PROGRAMS
= vlock vlock-main
16 $(CC
) $(CFLAGS
) -S
-o
/dev
/null
$(CHK_SOURCES
)
22 ifeq ($(ENABLE_PLUGINS
),yes
)
27 plugins
: modules scripts
37 .PHONY
: check memcheck
43 uncrustify
-c .uncrustify.cfg
--mtime
--no-backup
$(wildcard src
/*.c src
/*.h
)
49 $(info ###################################################)
50 $(info # Creating default configuration. #)
51 $(info # Run ./configure or edit config.mk to customize. #)
52 $(info ###################################################)
56 ### installation rules ###
59 install: install-programs install-man
61 ifeq ($(ENABLE_PLUGINS
),yes
)
62 install: install-plugins
65 .PHONY
: install-programs
66 install-programs
: $(PROGRAMS
)
67 $(MKDIR_P
) -m
755 $(DESTDIR
)$(PREFIX
)/bin
68 $(INSTALL
) -m
755 -o root
-g
$(ROOT_GROUP
) vlock
$(DESTDIR
)$(BINDIR
)/vlock
69 $(MKDIR_P
) -m
755 $(DESTDIR
)$(PREFIX
)/sbin
70 $(INSTALL
) -m
4711 -o root
-g
$(ROOT_GROUP
) vlock-main
$(DESTDIR
)$(SBINDIR
)/vlock-main
72 .PHONY
: install-plugins
73 install-plugins
: install-modules install-scripts
75 .PHONY
: install-modules
77 @
$(MAKE
) -C modules
install
79 .PHONY
: install-scripts
81 @
$(MAKE
) -C scripts
install
85 $(MKDIR_P
) -m
755 $(DESTDIR
)$(MANDIR
)/man1
86 $(INSTALL
) -m
644 -o root
-g
$(ROOT_GROUP
) man
/vlock
.1 $(DESTDIR
)$(MANDIR
)/man1
/vlock
.1
87 $(MKDIR_P
) -m
755 $(DESTDIR
)$(MANDIR
)/man8
88 $(INSTALL
) -m
644 -o root
-g
$(ROOT_GROUP
) man
/vlock-main
.8 $(DESTDIR
)$(MANDIR
)/man8
/vlock-main
.8
89 $(MKDIR_P
) -m
755 $(DESTDIR
)$(MANDIR
)/man5
90 $(INSTALL
) -m
644 -o root
-g
$(ROOT_GROUP
) man
/vlock-plugins
.5 $(DESTDIR
)$(MANDIR
)/man5
/vlock-plugins
.5
95 vlock
: vlock.sh config.mk Makefile
98 -e
's,%BOURNE_SHELL%,$(BOURNE_SHELL),' \
99 -e
's,%PREFIX%,$(PREFIX),' \
100 -e
's,%VLOCK_VERSION%,$(VLOCK_VERSION),' \
101 -e
's,%VLOCK_ENABLE_PLUGINS%,$(ENABLE_PLUGINS),' \
105 override CFLAGS
+= -Isrc
107 VLOCK_MAIN_SOURCES
= \
110 auth-
$(AUTH_METHOD
).c \
117 VLOCK_MAIN_OBJECTS
= $(VLOCK_MAIN_SOURCES
:.c
=.o
)
119 ifeq ($(ENABLE_PLUGINS
),yes
)
120 VLOCK_MAIN_SOURCES
+= plugins.c plugin.c module.c process.c script.c tsort.c
122 # -rdynamic is needed so that the all plugin can access the symbols from console_switch.o
123 vlock-main
: override LDFLAGS
+= -rdynamic
124 vlock-main
: override LDLIBS
+= $(DL_LIB
)
125 vlock-main.o
: override CFLAGS
+= -DUSE_PLUGINS
127 module.o
: override CFLAGS
+= -DVLOCK_MODULE_DIR
="\"$(MODULEDIR)\""
128 script.o
: override CFLAGS
+= -DVLOCK_SCRIPT_DIR
="\"$(SCRIPTDIR)\""
131 ifneq ($(ENABLE_ROOT_PASSWORD
),yes
)
132 vlock-main.o
: override CFLAGS
+= -DNO_ROOT_PASS
135 ifeq ($(AUTH_METHOD
),pam
)
136 vlock-main
: override LDLIBS
+= $(PAM_LIBS
)
139 ifeq ($(AUTH_METHOD
),shadow
)
140 vlock-main
: override LDLIBS
+= $(CRYPT_LIB
)
143 vlock-main
: $(VLOCK_MAIN_OBJECTS
)
145 # dependencies generated by gcc
148 .deps.mk
: $(VLOCK_MAIN_SOURCES
)
149 $(info Regenerating dependencies ...
)
150 @
$(CC
) $(CFLAGS
) -MM
$^
> $@
158 $(RM
) $(PROGRAMS
) $(VLOCK_MAIN_OBJECTS
) .deps.mk
159 @
$(MAKE
) -C modules
clean
160 @
$(MAKE
) -C scripts
clean
161 @
$(MAKE
) -C tests
clean