Package: libx86emu / 2.2-1

0001-friendly-makefile.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From: Tomasz Buchert <tomasz@debian.org>
Date: Thu, 2 Aug 2018 11:43:04 +0800
Subject: friendly makefile

---
 .gitignore |  1 -
 Makefile   | 28 +++++++++-------------------
 VERSION    |  1 +
 3 files changed, 10 insertions(+), 20 deletions(-)
 create mode 100644 VERSION

diff --git a/.gitignore b/.gitignore
index 0b89911..6d10dce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
 changelog
-VERSION
diff --git a/Makefile b/Makefile
index 6fa6fcc..b074253 100644
--- a/Makefile
+++ b/Makefile
@@ -3,20 +3,14 @@ ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
 ARCH	:= i386
 endif
 
-GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
-GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
-VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
-BRANCH  := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
-PREFIX  := libx86emu-$(VERSION)
+CC	?= gcc
+CFLAGS	+= -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
 
-MAJOR_VERSION := $(shell $(GIT2LOG) --version VERSION ; cut -d . -f 1 VERSION)
-
-CC	= gcc
-CFLAGS	= -g -O2 -fPIC -fvisibility=hidden -fomit-frame-pointer -Wall
-
-LIBDIR = /usr/lib$(shell ldd /bin/sh | grep -q /lib64/ && echo 64)
 LIBX86	= libx86emu
 
+VERSION := $(shell cat VERSION)
+MAJOR_VERSION := $(shell cut -d . -f 1 VERSION)
+
 CFILES	= $(wildcard *.c)
 OBJS	= $(CFILES:.c=.o)
 
@@ -26,12 +20,9 @@ LIB_SONAME	= $(LIBX86).so.$(MAJOR_VERSION)
 .PHONY: all shared install test demo clean
 
 %.o: %.c
-	$(CC) -c $(CFLAGS) $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $<
 
-all: changelog shared
-
-changelog: $(GITDEPS)
-	$(GIT2LOG) --changelog changelog
+all: shared
 
 shared: $(LIB_NAME)
 
@@ -42,7 +33,7 @@ install: shared
 	install -m 644 -D include/x86emu.h $(DESTDIR)/usr/include/x86emu.h
 
 $(LIB_NAME): .depend $(OBJS)
-	$(CC) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) $(OBJS) -o $(LIB_NAME)
 	@ln -snf $(LIB_NAME) $(LIB_SONAME)
 	@ln -snf $(LIB_SONAME) $(LIBX86).so
 
@@ -67,7 +58,6 @@ clean:
 
 ifneq "$(MAKECMDGOALS)" "clean"
 .depend: $(CFILES)
-	@$(CC) -MG -MM $(CFLAGS) $(CFILES) >$@
+	@$(CC) -MG -MM $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(CFILES) >$@
 -include .depend
 endif
-
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..cd5ac03
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+2.0