Add simple check target that runs a sanity check of the build environment.
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 19 Apr 2005 03:50:28 +0000 (03:50 +0000)
committerKristian Høgsberg <krh@src.gnome.org>
Tue, 19 Apr 2005 03:50:28 +0000 (03:50 +0000)
Tue Apr 19 23:26:45 2005  Kristian Høgsberg  <krh@bitplanet.net>

        * Makefile (check): Add simple check target that runs a sanity
        check of the build environment.

ChangeLog
Makefile

index 094fdfe..9830252 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 19 23:26:45 2005  Kristian Høgsberg  <krh@bitplanet.net>
+
+       * Makefile (check): Add simple check target that runs a sanity
+       check of the build environment.
+
 Sun Apr 17 00:20:41 2005  Soeren Sandmann  <sandmann@redhat.com>
 
        * sysprof.c (on_open_clicked): Factor out some stuff in their own
index 4013c14..5f7fc2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,12 +12,18 @@ profile.c treeviewutils.c sfile.c
 OBJS     := $(addsuffix .o, $(basename $(C_FILES)))
 BINARY    := sysprof
 MODULE    := sysprof-module
-INCLUDE   := -isystem /lib/modules/`uname -r`/build/include
-MODCFLAGS := -O2 -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
 KDIR      := /lib/modules/$(shell uname -r)/build
+INCLUDE   := -isystem $(KDIR)/include
+MODCFLAGS := -O2 -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
 MODULE    := sysprof-module
 
-all: $(BINARY) $(MODULE).o
+all: check $(BINARY) $(MODULE).o
+
+check:
+       pkg-config gtk+-2.0 libglade-2.0
+       @[ -r $(KDIR)/include/linux/kernel.h ] || (echo No kernel headers found; exit 1)
+       @[ -r /usr/include/bzlib.h ] || (echo bzip2 header file not found; exit 1)
+       touch check
 
 $(BINARY): $(OBJS) depend
        $(CC) $(OBJS) $(LIBS) -o$(BINARY)