aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 14:44:12 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 14:44:12 +0000
commitd5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70 (patch)
tree13a7f17e78af6329cce8bfc2c9de23b26b008c16 /Makefile
parent7111121ef0321ecc185eb0af571394e9ccdd8d38 (diff)
downloadmonitor-edid-d5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70.tar
monitor-edid-d5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70.tar.gz
monitor-edid-d5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70.tar.bz2
monitor-edid-d5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70.tar.xz
monitor-edid-d5fb67db9d6d614130a1879a7f4b5c6c7cdfdd70.zip
Auto-detect package VERSION from specfile. Fix build when CFLAGS variable is
overridden (RPM build).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1c31330..d6cec73 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PACKAGE = monitor-edid
-VERSION = 1.10
+VERSION = $(shell rpm -q --qf "%{VERSION}\n" --specfile $(PACKAGE).spec | head -n 1)
FILES = $(shell ls | grep -v CVS | grep -vF .tar)
ARCH := $(patsubst i%86,i386,$(shell uname -m))
@@ -18,7 +18,8 @@ endif
TARGETS = monitor-get-edid-using-vbe cvt
-CFLAGS = -O -Wall -g -I.
+CPPFLAGS = -I.
+CFLAGS = -O -Wall -g
OBJS = monitor-get-edid-using-vbe.c vbe.o libint10.a libx86emu.a
ifeq (i386,$(ARCH))
@@ -43,6 +44,9 @@ clean:
$(RM) $(TARGETS) *.a *.o *~
rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2
+%.o: %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
# rules to build a test rpm