aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-19 16:42:28 +0000
committerRoy Marples <roy@marples.name>2007-11-19 16:42:28 +0000
commit88ccccc22a3f8938bcd43ffbe86d3b9c3c814ad3 (patch)
treee4637b861c8a4f65713d6825b8c6749bdfa0fa66 /src/Makefile
parent81715c31594ac2f02b1d73dc9df0a7e9a19ca9a7 (diff)
Move runlevel and lib logic to the sub Makefiles
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/Makefile b/src/Makefile
index 0e449194..966f9339 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,12 +6,6 @@
# to type make instead of gmake, but also so that other distros can pick
# it up and not rely on GNU Make.
-# NOTE:- FreeBSD and DragonFly have no way of optionally including files
-# that works with GNU make and vice versa. NetBSD and OpenBSD makes do.
-# You can get a patch from
-# http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/116081
-# to fix this.
-
CC ?= gcc
CFLAGS += -O2 -pipe
LDFLAGS += -L.
@@ -22,7 +16,7 @@ check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
# pmake check for extra cflags
WEXTRA != for x in -Wdeclaration-after-statement -Wsequence-point -Wextra; do \
- if $(CC) -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
+ if $(CC) -W$$x -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo -n "$$x "; fi \
done
@@ -101,6 +95,9 @@ include Makefile.$(PAM)
all: .depend $(TARGET)
+version.h:
+ sed -n -e 's/^VERSION =[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1\"/p' ../Makefile > version.h
+
$(LIBEINFOOBJS):
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
$(LIBEINFOSO): einfo.map $(LIBEINFOOBJS)
@@ -160,10 +157,10 @@ install:: $(TARGET)
clean-links:
rm -f $(ALL_LINKS)
-clean::
+clean:: clean-links
echo > .depend
touch -r Makefile .depend
- rm -f $(TARGET)
+ rm -f $(TARGET) version.h
rm -f *.o *~ *.core *.so *.a
check:
@@ -171,7 +168,5 @@ check:
include .depend
_DEPS != ls *.c *.h
-.depend: $(_DEPS)$(wildcard *.c *.h)
+.depend: version.h $(_DEPS)$(wildcard *.c *.h)
$(CC) $(CPPFLAGS) -MM *.c > .depend
-
-.PHONY: all clean clean-links install links