Commit cb0c7548 authored by Tomasz Buchert's avatar Tomasz Buchert

refresh patches

parent fcf76721
From: Tomasz Buchert <tomasz@debian.org>
Date: Tue, 1 May 2018 21:55:37 +0200
Subject: friendly-makefile
Date: Thu, 2 Aug 2018 11:43:04 +0800
Subject: friendly makefile
Description : Fix upstream Makefile
The upstream Makefile is OpenSUSE-specific, let debianize it and activate
hardening flags.
Author: Tomasz Buchert <tomasz@debian.org>
Forwarded: not-needed
Last-Update: 2015-03-08
Reviewed-By: Sebastien Badia <seb@sebian.fr>
Conflicts:
Makefile
---
Makefile | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
.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 48ca5c7..2e21085 100644
index 6fa6fcc..b074253 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,25 @@
+DPKG_EXPORT_BUILDFLAGS=1
+include /usr/share/dpkg/buildflags.mk
+
ARCH := $(shell uname -m)
ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
@@ -3,20 +3,14 @@ ifneq ($(filter i386 i486 i586 i686, $(ARCH)),)
ARCH := i386
endif
......@@ -34,62 +29,60 @@ index 48ca5c7..2e21085 100644
-VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
-BRANCH := $(shell [ -d .git ] && git branch | perl -ne 'print $$_ if s/^\*\s*//')
-PREFIX := libx86emu-$(VERSION)
-
-MAJOR_VERSION := $(shell $(GIT2LOG) --version VERSION ; cut -d . -f 1 VERSION)
+CC ?= gcc
+CFLAGS += -g -O2 -fPIC -fomit-frame-pointer -Wall
+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 -fomit-frame-pointer -Wall
-ifneq ($(filter x86_64, $(ARCH)),)
-LIBDIR = /usr/lib64
-else
-LIBDIR = /usr/lib
+ifndef LIBDIR
+ ifneq ($(filter x86_64, $(ARCH)),)
+ LIBDIR = /usr/lib64
+ else
+ LIBDIR = /usr/lib
+ endif
endif
-LIBX86 = libx86emu
+
+LIBX86 := libx86emu
-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)
@@ -29,12 +30,9 @@ LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)
@@ -26,12 +20,9 @@ LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)
.PHONY: all shared install test demo clean
%.o: %.c
- $(CC) -c $(CFLAGS) $<
-
-all: changelog shared
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $<
-all: changelog shared
-
-changelog: $(GITDEPS)
- $(GIT2LOG) --changelog changelog
+all: shared
shared: $(LIB_NAME)
@@ -45,7 +43,7 @@ install: shared
@@ -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) $(CPPLAGS) $(LDFLAGS) -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
test:
make -C test
@@ -68,7 +66,7 @@ clean:
@@ -67,7 +58,6 @@ clean:
ifneq "$(MAKECMDGOALS)" "clean"
.depend: $(CFILES)
- @$(CC) -MG -MM $(CFLAGS) $(CFILES) >$@
+ @$(CC) -MG -MM $(CFLAGS) $(CPPLAGS) $(LDFLAGS) $(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
From: Tomasz Buchert <tomasz@debian.org>
Date: Wed, 30 May 2018 21:18:19 +0200
Subject: make sure VERSION exists
---
.gitignore | 1 -
Makefile | 3 +--
VERSION | 1 +
3 files changed, 2 insertions(+), 3 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 2e21085..292016d 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ LIB_SONAME = $(LIBX86).so.$(MAJOR_VERSION)
%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $<
-all: shared
+all: VERSION shared
shared: $(LIB_NAME)
@@ -69,4 +69,3 @@ ifneq "$(MAKECMDGOALS)" "clean"
@$(CC) -MG -MM $(CFLAGS) $(CPPLAGS) $(LDFLAGS) $(CFILES) >$@
-include .depend
endif
-
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..ba885f1
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.14
\ No newline at end of file
0001-friendly-makefile.patch
0002-make-sure-VERSION-exists.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment