CFLAGS=@CFLAGS@
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
+LIBTOOL=@LIBTOOL@
PRO_C=@PRO_C@
PRO_C_DEFS=@PRO_C_DEFS@
PRO_C_INCLUDES=@PRO_C_INCLUDES@
srcdir=@srcdir@
VPATH=@srcdir@
SRCTOP=@top_srcdir@
+top_builddir=@top_builddir@
BUILDTOP=..
mrbindir=@mrbindir@
-STUDENT_OBJS=student.o common.o
-STAFF_OBJS=staff.o common.o
-VOTE_OBJS=vote.o
+STUDENT_OBJS=student.lo common.lo
+STAFF_OBJS=staff.lo common.lo
+VOTE_OBJS=vote.lo
CFILES=student.c staff.c common.c vote.c
TARGET=student staff vote
+SCRIPTS=grouper.pl staff.sql stellar.pl student.sql
-.SUFFIXES: .pc
+.SUFFIXES: .pc .lo
.pc.c:
$(PRO_C) $(PRO_C_FLAGS) INAME=$< ONAME=$@
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $<
+.c.lo:
+ $(LIBTOOL) --mode=compile $(CC) -c $(ALL_CFLAGS) $<
all: $(TARGET)
clean:
- rm -f $(STUDENT_OBJS) $(STAFF_OBJS) $(VOTE_OBJS)
- rm -f $(CFILES) $(TARGET)
+ $(LIBTOOL) --mode=clean rm -f $(STUDENT_OBJS) $(STAFF_OBJS) $(VOTE_OBJS)
+ $(LIBTOOL) --mode=clean rm -f $(CFILES) $(TARGET)
cleandir distclean: clean
rm -f Makefile
depend: $(CFILES)
install:
- @set -x; for p in $(TARGET); do $(INSTALL_PROGRAM) $$p $(mrbindir); done
+ @set -x; for p in $(TARGET); do $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(mrbindir); done
+ @set -x; for p in $(SCRIPTS); do $(INSTALL_PROGRAM) $$p $(DESTDIR)$(mrbindir); done
student: $(STUDENT_OBJS) $(MR_LIBDEP)
- $(CC) -o $@ $(LDFLAGS) $(STUDENT_OBJS) $(SQL_LIBS) $(LIBS)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(STUDENT_OBJS) $(SQL_LIBS) $(LIBS)
staff: $(STAFF_OBJS) $(MR_LIBDEP)
- $(CC) -o $@ $(LDFLAGS) $(STAFF_OBJS) $(SQL_LIBS) $(LIBS)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(STAFF_OBJS) $(SQL_LIBS) $(LIBS)
vote: $(VOTE_OBJS) $(MR_LIBDEP)
- $(CC) -o $@ $(LDFLAGS) $(VOTE_OBJS) $(SQL_LIBS) $(LIBS)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LDFLAGS) $(VOTE_OBJS) $(SQL_LIBS) $(LIBS)