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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
--- lshw-B.02.15.orig/src/core/Makefile
+++ lshw-B.02.15/src/core/Makefile
@@ -1,10 +1,10 @@
PACKAGENAME?=lshw
-CXX=c++
+CXX?=c++
INCLUDES=
DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
-CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
-LDFLAGS=
+CXXFLAGS ?= -g
+CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
LDSTATIC=
LIBS=
--- lshw-B.02.15.orig/src/gui/Makefile
+++ lshw-B.02.15/src/gui/Makefile
@@ -8,11 +8,11 @@
DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
INCLUDES=-I../core $(GTKINCLUDES)
-CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+CXXFLAGS ?= -g
+CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
CFLAGS=$(CXXFLAGS) $(DEFINES)
GTKLIBS=$(shell pkg-config gtk+-2.0 --libs)
LIBS=-L../core -llshw -lresolv -lsqlite3 $(GTKLIBS)
-LDFLAGS=
ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
LDFLAGS+= -Wl,--as-needed
endif
@@ -39,7 +39,6 @@
$(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
install: all
- $(STRIP) gtk-$(PACKAGENAME)
clean:
rm -f $(OBJS) gtk-$(PACKAGENAME) gtk-lshw.glade.bak gtk-lshw.gladep.bak interface.c.bak interface.h.bak callbacks.c.bak callbacks.h.bak Makefile.bak
--- lshw-B.02.15.orig/src/Makefile
+++ lshw-B.02.15/src/Makefile
@@ -21,11 +21,13 @@
CXX?=c++
INCLUDES=-I./core/
DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
-CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+CXXFLAGS ?= -g
+CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
ifeq ($(SQLITE), 1)
CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
endif
-LDFLAGS=-L./core/ -g
+LDFLAGS ?= -g
+LDFLAGS += -L./core/
ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
LDFLAGS+= -Wl,--as-needed
endif
@@ -48,18 +50,18 @@
.PHONY: core
core:
- +make -C core all
+ +$(MAKE) -C core all
$(PACKAGENAME): core $(PACKAGENAME).o
$(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
.PHONY: po
po:
- +make -C po all
+ +$(MAKE) -C po all
.PHONY: gui
gui: core
- +make -C gui all
+ +$(MAKE) -C gui all
.PHONY: nologo
nologo:
@@ -70,7 +72,6 @@
$(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o
$(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
- $(STRIP) $@
.PHONY: compressed
compressed: $(PACKAGENAME)-compressed
@@ -93,14 +94,14 @@
manuf.txt:
wget http://www.ethereal.com/distribution/manuf.txt
-install: all
+install:
$(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
$(INSTALL) -m 0755 $(PACKAGENAME) $(DESTDIR)/$(SBINDIR)
$(INSTALL) -d -m 0755 $(DESTDIR)/$(MANDIR)/man1
$(INSTALL) -m 0644 $(PACKAGENAME).1 $(DESTDIR)/$(MANDIR)/man1
$(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
$(INSTALL) -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
- make -C po install
+ $(MAKE) -C po install
install-gui: gui
$(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
@@ -110,8 +111,8 @@
clean:
rm -f $(PACKAGENAME).o $(PACKAGENAME) $(PACKAGENAME)-static $(PACKAGENAME)-compressed
- make -C core clean
- make -C gui clean
+ $(MAKE) -C core clean
+ $(MAKE) -C gui clean
.timestamp:
date --utc +%Y%m%d%H%M%S > $@
|