004e302
diff --git a/Makefile b/Makefile
004e302
index 4457bad..91de40b 100644
004e302
--- a/Makefile
004e302
+++ b/Makefile
004e302
@@ -13,17 +13,10 @@ CRACKLIB=/usr/share/cracklib/pw_dict
4840f8d
 #
4840f8d
 CONFIG=/etc/openldap/check_password.conf
4840f8d
 
004e302
-
4840f8d
-# Where to find the OpenLDAP headers.
4840f8d
-#
004e302
-LDAP_INC=-I/usr/include/openldap/include \
004e302
-	 -I/usr/include/openldap/servers/slapd
4840f8d
-
4840f8d
-# Where to find the CrackLib headers.
4840f8d
-#
4840f8d
-CRACK_INC=
4840f8d
-
4840f8d
-INCS=$(LDAP_INC) $(CRACK_INC)
004e302
+CFLAGS+=-fpic                                                  \
004e302
+	-DHAVE_CRACKLIB -DCRACKLIB_DICTPATH="\"$(CRACKLIB)\""  \
004e302
+	-DCONFIG_FILE="\"$(CONFIG)\""                          \
004e302
+	-DDEBUG
004e302
 
4840f8d
 LDAP_LIB=-lldap_r -llber
4840f8d
 
004e302
@@ -33,27 +26,21 @@ LDAP_LIB=-lldap_r -llber
004e302
 #
004e302
 CRACKLIB_LIB=-lcrack
004e302
 
004e302
-CC_FLAGS=-g -O2 -Wall -fpic
004e302
-CRACKLIB_OPT=-DHAVE_CRACKLIB -DCRACKLIB_DICTPATH="\"$(CRACKLIB)\""
004e302
-DEBUG_OPT=-DDEBUG
004e302
-CONFIG_OPT=-DCONFIG_FILE="\"$(CONFIG)\""
004e302
-
004e302
-OPT=$(CC_FLAGS) $(CRACKLIB_OPT) $(CONFIG_OPT) $(DEBUG_OPT)
004e302
-
004e302
 LIBS=$(LDAP_LIB) $(CRACKLIB_LIB)
004e302
 
004e302
 LIBDIR=/usr/lib/openldap/
004e302
 
004e302
+
4840f8d
 all: 	check_password
4840f8d
 
4840f8d
 check_password.o:
4840f8d
-	$(CC) $(OPT) -c $(INCS) check_password.c
4840f8d
+	$(CC) $(CFLAGS) -c $(LDAP_INC) check_password.c
4840f8d
 
4840f8d
 check_password: clean check_password.o
4840f8d
-	$(CC) -shared -o check_password.so check_password.o $(CRACKLIB_LIB)
4840f8d
+	$(CC) $(LDFLAGS) -shared -o check_password.so check_password.o $(CRACKLIB_LIB)
4840f8d
 
4840f8d
 install: check_password
004e302
-	cp -f check_password.so $(LIBDIR)
004e302
+	cp -f check_password.so ../../../usr/lib/openldap/modules/
004e302
 
004e302
 clean:
004e302
 	$(RM) check_password.o check_password.so check_password.lo