You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
5.8 KiB

  1. Some makefile modifications to:
  2. >>disable the logic that detects and sets architecture (it screws up cross-compiling)
  3. >>disable some secondary build functions like creating changelogs or report files for other tools
  4. >>disable the install functionality as we take the files we need with OpenWrt build system
  5. >>changes to all makefiles to respect the compile flags
  6. --- a/Makefile
  7. +++ b/Makefile
  8. @@ -1,6 +1,6 @@
  9. TOPDIR = $(CURDIR)
  10. SUBDIRS = src
  11. -TARGETS = hwinfo hwinfo.pc changelog
  12. +TARGETS = hwinfo
  13. CLEANFILES = hwinfo hwinfo.pc hwinfo.static hwscan hwscan.static hwscand hwscanqueue doc/libhd doc/*~
  14. LIBS = -lhd
  15. SLIBS = -lhd -luuid
  16. @@ -18,11 +18,11 @@
  17. include Makefile.common
  18. -ifeq "$(ARCH)" "x86_64"
  19. -LIBDIR ?= /usr/lib64
  20. -else
  21. +#ifeq "$(ARCH)" "x86_64"
  22. +#LIBDIR ?= /usr/lib64
  23. +#else
  24. LIBDIR ?= /usr/lib
  25. -endif
  26. +#endif
  27. ULIBDIR = $(LIBDIR)
  28. # this library has been removed from the code, disabling it here too
  29. @@ -39,13 +39,13 @@
  30. .PHONY: fullstatic static shared tiny doc diet tinydiet uc tinyuc
  31. -ifdef HWINFO_VERSION
  32. +#ifdef HWINFO_VERSION
  33. changelog:
  34. @true
  35. -else
  36. -changelog: $(GITDEPS)
  37. - $(GIT2LOG) --changelog changelog
  38. -endif
  39. +#else
  40. +#changelog: $(GITDEPS)
  41. +# $(GIT2LOG) --changelog changelog
  42. +#endif
  43. hwscan: hwscan.o $(LIBHD)
  44. $(CC) hwscan.o $(LDFLAGS) $(CFLAGS) $(LIBS) -o $@
  45. @@ -99,28 +99,29 @@
  46. @cd doc ; doxygen libhd.doxy
  47. install:
  48. - install -d -m 755 $(DESTDIR)/sbin $(DESTDIR)/usr/sbin $(DESTDIR)$(ULIBDIR) \
  49. - $(DESTDIR)$(ULIBDIR)/pkgconfig $(DESTDIR)/usr/include
  50. - install -m 755 hwinfo $(DESTDIR)/usr/sbin
  51. - install -m 755 src/ids/check_hd $(DESTDIR)/usr/sbin
  52. - install -m 755 src/ids/convert_hd $(DESTDIR)/usr/sbin
  53. - if [ -f $(LIBHD_SO) ] ; then \
  54. - install $(LIBHD_SO) $(DESTDIR)$(ULIBDIR) ; \
  55. - ln -snf $(LIBHD_NAME) $(DESTDIR)$(ULIBDIR)/$(LIBHD_SONAME) ; \
  56. - ln -snf $(LIBHD_SONAME) $(DESTDIR)$(ULIBDIR)/$(LIBHD_BASE).so ; \
  57. - else \
  58. - install -m 644 $(LIBHD) $(DESTDIR)$(ULIBDIR) ; \
  59. - fi
  60. - install -m 644 hwinfo.pc $(DESTDIR)$(ULIBDIR)/pkgconfig
  61. - install -m 644 src/hd/hd.h $(DESTDIR)/usr/include
  62. - perl -pi -e "s/define\s+HD_VERSION\b.*/define HD_VERSION\t\t$(LIBHD_MAJOR_VERSION)/" $(DESTDIR)/usr/include/hd.h
  63. - perl -pi -e "s/define\s+HD_MINOR_VERSION\b.*/define HD_MINOR_VERSION\t$(LIBHD_MINOR_VERSION)/" $(DESTDIR)/usr/include/hd.h
  64. - install -m 755 getsysinfo $(DESTDIR)/usr/sbin
  65. - install -m 755 src/isdn/cdb/mk_isdnhwdb $(DESTDIR)/usr/sbin
  66. - install -d -m 755 $(DESTDIR)/usr/share/hwinfo
  67. - install -d -m 755 $(DESTDIR)/var/lib/hardware/udi
  68. - install -m 644 src/isdn/cdb/ISDN.CDB.txt $(DESTDIR)/usr/share/hwinfo
  69. - install -m 644 src/isdn/cdb/ISDN.CDB.hwdb $(DESTDIR)/usr/share/hwinfo
  70. +# install -d -m 755 $(DESTDIR)/sbin $(DESTDIR)/usr/sbin $(DESTDIR)$(ULIBDIR) \
  71. +# $(DESTDIR)$(ULIBDIR)/pkgconfig $(DESTDIR)/usr/include
  72. +# install -m 755 hwinfo $(DESTDIR)/usr/sbin
  73. +# install -m 755 src/ids/check_hd $(DESTDIR)/usr/sbin
  74. +# install -m 755 src/ids/convert_hd $(DESTDIR)/usr/sbin
  75. +# if [ -f $(LIBHD_SO) ] ; then \
  76. +# install $(LIBHD_SO) $(DESTDIR)$(ULIBDIR) ; \
  77. +# ln -snf $(LIBHD_NAME) $(DESTDIR)$(ULIBDIR)/$(LIBHD_SONAME) ; \
  78. +# ln -snf $(LIBHD_SONAME) $(DESTDIR)$(ULIBDIR)/$(LIBHD_BASE).so ; \
  79. +# else \
  80. +# install -m 644 $(LIBHD) $(DESTDIR)$(ULIBDIR) ; \
  81. +# fi
  82. +# install -m 644 hwinfo.pc $(DESTDIR)$(ULIBDIR)/pkgconfig
  83. +# install -m 644 src/hd/hd.h $(DESTDIR)/usr/include
  84. +# perl -pi -e "s/define\s+HD_VERSION\b.*/define HD_VERSION\t\t$(LIBHD_MAJOR_VERSION)/" $(DESTDIR)/usr/include/hd.h
  85. +# perl -pi -e "s/define\s+HD_MINOR_VERSION\b.*/define HD_MINOR_VERSION\t$(LIBHD_MINOR_VERSION)/" $(DESTDIR)/usr/include/hd.h
  86. +# install -m 755 getsysinfo $(DESTDIR)/usr/sbin
  87. +# install -m 755 src/isdn/cdb/mk_isdnhwdb $(DESTDIR)/usr/sbin
  88. +# install -d -m 755 $(DESTDIR)/usr/share/hwinfo
  89. +# install -d -m 755 $(DESTDIR)/var/lib/hardware/udi
  90. +# install -m 644 src/isdn/cdb/ISDN.CDB.txt $(DESTDIR)/usr/share/hwinfo
  91. +# install -m 644 src/isdn/cdb/ISDN.CDB.hwdb $(DESTDIR)/usr/share/hwinfo
  92. + @true
  93. archive: changelog
  94. @if [ ! -d .git ] ; then echo no git repo ; false ; fi
  95. --- a/Makefile.common
  96. +++ b/Makefile.common
  97. @@ -1,28 +1,26 @@
  98. # libhd/Makefile.common
  99. -ARCH := $(shell uname -m)
  100. -ifeq "$(ARCH)" "i486"
  101. -ARCH := i386
  102. -endif
  103. -ifeq "$(ARCH)" "i586"
  104. -ARCH := i386
  105. -endif
  106. -ifeq "$(ARCH)" "i686"
  107. -ARCH := i386
  108. -endif
  109. -ifeq "$(ARCH)" "parisc"
  110. -EXTRA_FLAGS := -fPIC $(EXTRA_FLAGS)
  111. -endif
  112. +#ARCH := $(shell uname -m)
  113. +#ifeq "$(ARCH)" "i486"
  114. +#ARCH := i386
  115. +#endif
  116. +#ifeq "$(ARCH)" "i586"
  117. +#ARCH := i386
  118. +#endif
  119. +#ifeq "$(ARCH)" "i686"
  120. +#ARCH := i386
  121. +#endif
  122. +#ifeq "$(ARCH)" "parisc"
  123. +#EXTRA_FLAGS := -fPIC $(EXTRA_FLAGS)
  124. +#endif
  125. LIBHD_VERSION := $(shell cat $(TOPDIR)/VERSION)
  126. LIBHD_MINOR_VERSION := $(shell cut -d . -f 2 $(TOPDIR)/VERSION)
  127. LIBHD_MAJOR_VERSION := $(shell cut -d . -f 1 $(TOPDIR)/VERSION)
  128. -RPM_OPT_FLAGS ?= -O2
  129. -
  130. CC ?= gcc
  131. LD = ld
  132. -CFLAGS += $(RPM_OPT_FLAGS) -Wall -Wno-pointer-sign -pipe -g $(SHARED_FLAGS) $(EXTRA_FLAGS) -I$(TOPDIR)/src/hd
  133. +CFLAGS += -Wall -Wno-pointer-sign $(SHARED_FLAGS) $(EXTRA_FLAGS) -I$(TOPDIR)/src/hd
  134. SHARED_FLAGS = -fPIC
  135. LDFLAGS += -Lsrc
  136. @@ -36,7 +34,7 @@
  137. LIBHD_SO = $(TOPDIR)/src/$(LIBHD_NAME)
  138. LIBHD_D = $(TOPDIR)/src/.lib
  139. -export CC TOPDIR CFLAGS LIBHD ARCH
  140. +export CC TOPDIR CFLAGS LIBHD
  141. .PHONY: all distclean clean install subdirs
  142. --- a/src/Makefile
  143. +++ b/src/Makefile
  144. @@ -12,7 +12,7 @@
  145. #endif
  146. $(LIBHD): $(OBJS)
  147. - ar r $@ $?
  148. + $(AR) r $@ $?
  149. @rm -f $(LIBHD_D)
  150. ifdef SHARED_FLAGS
  151. --- a/src/hd/Makefile
  152. +++ b/src/hd/Makefile
  153. @@ -12,4 +12,4 @@
  154. @perl -pi -e "s/define\s+HD_MINOR_VERSION\s+\d+/define HD_MINOR_VERSION\t$(LIBHD_MINOR_VERSION)/" $@
  155. $(LIBHD_D): $(OBJS)
  156. - ar r $(LIBHD) $?
  157. + $(AR) r $(LIBHD) $?
  158. --- a/src/isdn/Makefile
  159. +++ b/src/isdn/Makefile
  160. @@ -5,5 +5,5 @@
  161. include $(TOPDIR)/Makefile.common
  162. $(LIBHD_D): $(OBJS)
  163. - ar r $(LIBHD) $?
  164. + $(AR) r $(LIBHD) $?
  165. --- a/src/smp/Makefile
  166. +++ b/src/smp/Makefile
  167. @@ -4,4 +4,4 @@
  168. include $(TOPDIR)/Makefile.common
  169. $(LIBHD_D): $(OBJS)
  170. - ar r $(LIBHD) $?
  171. + $(AR) r $(LIBHD) $?