Allow depend creation again. This doesn't work on GNU make, but does on all others.

This commit is contained in:
Roy Marples 2008-01-07 14:20:13 +00:00
parent c256510570
commit d22fc0dd93
10 changed files with 32 additions and 11 deletions

View File

@ -23,3 +23,4 @@ CFLAGS += -pedantic -std=c99 \
$(call check_gcc, -Wdeclaration-after-statement) \
$(call check_gcc, -Wsequence-point) \
$(call check_gcc, -Wextra) $(WEXTRA)

10
src/depend.mk Normal file
View File

@ -0,0 +1,10 @@
# This only works for make implementations that always include a .depend if
# it exists. Only GNU make does not do this.
.depend: ${SCRIPTS} ${SRCS}
$(CC) $(CFLAGS) -MM ${SRCS} > .depend
depend: .depend
clean-depend:
rm -f .depend

View File

@ -32,7 +32,7 @@ LIBMODE?= 0444
.c.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c $< -o $@
all: ${_LIBS}
all: depend ${_LIBS}
lib${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static library $@
@ -59,5 +59,7 @@ install: all
${INSTALL} -d ${DESTDIR}${INCDIR}
for x in ${INCS}; do ${INSTALL} -m ${INCMODE} $$x ${DESTDIR}${INCDIR}; done
clean:
clean: clean-depend
rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK}
include $(TOPDIR)/depend.mk

View File

@ -9,6 +9,8 @@ VERSION_MAP= einfo.map
SHLIBDIR= /${LIBNAME}
CFLAGS+= -I$(TOPDIR)
include $(TOPDIR)/cc.mk
include $(TOPDIR)/lib.mk
include $(TOPDIR)/$(TERMCAP).mk

View File

@ -50,7 +50,7 @@ const char libeinfo_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
#include <unistd.h>
#include "einfo.h"
#include "../hidden-visibility.h"
#include "hidden-visibility.h"
hidden_proto(ecolor)
hidden_proto(ebegin)
hidden_proto(ebeginv)

View File

@ -11,6 +11,8 @@ VERSION_MAP= rc.map
CFLAGS+= -DLIB=\"${LIBNAME}\"
LDADD+= ${LIBKVM}
CFLAGS+= -I$(TOPDIR)
SHLIBDIR= /${LIBNAME}
include $(TOPDIR)/cc.mk

View File

@ -65,10 +65,10 @@
#include "librc-depend.h"
#include "rc.h"
#include "../rc-misc.h"
#include "../strlist.h"
#include "rc-misc.h"
#include "strlist.h"
#include "../hidden-visibility.h"
#include "hidden-visibility.h"
#define librc_hidden_proto(x) hidden_proto(x)
#define librc_hidden_def(x) hidden_def(x)

View File

@ -8,10 +8,12 @@ OBJS+= ${SRCS:.c=.o}
INSTALL?= install
all: ${PROG}
all: depend ${PROG}
${PROG}: ${SCRIPTS} ${OBJS}
${CC} ${CFLAGS} ${LDFLAGS} ${PROGLDFLAGS} -o $@ ${OBJS} ${LDADD}
clean:
clean: clean-depend
rm -f ${OBJS} ${PROG} ${CLEANFILES}
include $(TOPDIR)/depend.mk

View File

@ -39,10 +39,10 @@
#include <unistd.h>
#include "builtins.h"
#include "../libeinfo/einfo.h"
#include "einfo.h"
#include "rc.h"
#include "../rc-misc.h"
#include "../strlist.h"
#include "rc-misc.h"
#include "strlist.h"
static const char *applet = NULL;

View File

@ -23,3 +23,5 @@ clean:
$(_SUBDIR)
install:
$(_SUBDIR)
depend:
$(_SUBDIR)