The 'rules.mak' file now checks for an empty target,
and does nothing if so.
The various make files now rely on 'config.mak', and
re-set the TARGET to '' if their required libraries, etc.
do not exist.
fi
echo "#define $DEF" 1 >> config.h
else
+# We still want to output what we *would* have done to the
+# config files. But we output them commented out, so they don't take
+# affect.
echo no
+ echo "# $DEF=$LIBS" >>config.mak
+ echo "/* #define $DEF 1 */" >> config.h
fi
rm -f tmp$$.c tmp$$
}
SRCS = rlm_example.c
include ../rules.mak
-
+# must be first
+include config.mak
+
TARGET = rlm_pam
SRCS = rlm_pam.c
LIBS = -lpam -ldl
+# over-ride the previous assignment if we're not building anything
+ifeq ($(LIBPAM),)
+TARGET =
+endif
+
include ../rules.mak
+# must be last
config.mak:
@../checkconfig -l LIBPAM pam_start -lpam -ldl
+# must be first
+include config.mak
+
TARGET = rlm_mysql
SRCS = rlm_mysql.c mysql.c
+LIBS = -lmysql
+
+# over-ride the previous assignment if we're not building anything
+ifeq ($(LIBMYSQL),)
+TARGET =
+endif
include ../rules.mak
+
+# must be last
+config.mak:
+ @../checkconfig -l LIBMYSQL mysql_init -lmysql
CFLAGS += -I../../include
+ifneq ($(TARGET),)
#######################################################################
#
# Define a number of new targets
#
#######################################################################
static: $(TARGET).a
- @cp $< ..
+ @cp $< ../lib
dynamic: $(TARGET).so
- @cp $< ..
+ @cp $< ../lib
+
+#######################################################################
+#
+# It's a dummy target: don't build it
+#
+#######################################################################
+else
+static:
+
+dynamic:
+
+# if $(TARGET) == ""
+endif
#######################################################################
#