131.patch 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. From c435fc1c4ea1a61cf2c1c9adc561df143df10e97 Mon Sep 17 00:00:00 2001
  2. From: orbea <orbea@riseup.net>
  3. Date: Mon, 28 Dec 2020 10:19:34 -0800
  4. Subject: [PATCH 1/5] build: Remove root check for make install.
  5. ---
  6. bsnes/target-bsnes/GNUmakefile | 4 ----
  7. 1 file changed, 4 deletions(-)
  8. diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
  9. index f8f9fd2b..a22f3bbc 100644
  10. --- a/bsnes/target-bsnes/GNUmakefile
  11. +++ b/bsnes/target-bsnes/GNUmakefile
  12. @@ -40,8 +40,6 @@ verbose: hiro.verbose ruby.verbose nall.verbose all;
  13. install: all
  14. ifeq ($(platform),windows)
  15. -else ifeq ($(shell id -un),root)
  16. - $(error "make install should not be run as root")
  17. else ifeq ($(platform),macos)
  18. mkdir -p ~/Library/Application\ Support/$(name)/
  19. mkdir -p ~/Library/Application\ Support/$(name)/Database/
  20. @@ -67,8 +65,6 @@ endif
  21. uninstall:
  22. ifeq ($(platform),windows)
  23. -else ifeq ($(shell id -un),root)
  24. - $(error "make uninstall should not be run as root")
  25. else ifeq ($(platform),macos)
  26. rm -rf /Applications/$(name).app
  27. else ifneq ($(filter $(platform),linux bsd),)
  28. --
  29. 2.29.2
  30. From 9f9bdcb9a0316eca9368e860a5d4ce889d9201cb Mon Sep 17 00:00:00 2001
  31. From: orbea <orbea@riseup.net>
  32. Date: Mon, 28 Dec 2020 10:23:35 -0800
  33. Subject: [PATCH 2/5] build: Support DESTDIR.
  34. ---
  35. bsnes/target-bsnes/GNUmakefile | 38 +++++++++++++++++-----------------
  36. 1 file changed, 19 insertions(+), 19 deletions(-)
  37. diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
  38. index a22f3bbc..3d7ceaf7 100644
  39. --- a/bsnes/target-bsnes/GNUmakefile
  40. +++ b/bsnes/target-bsnes/GNUmakefile
  41. @@ -47,20 +47,20 @@ else ifeq ($(platform),macos)
  42. mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
  43. cp -R out/$(name).app /Applications/$(name).app
  44. else ifneq ($(filter $(platform),linux bsd),)
  45. - mkdir -p $(prefix)/bin/
  46. - mkdir -p $(prefix)/share/applications/
  47. - mkdir -p $(prefix)/share/icons/hicolor/256x256/apps/
  48. - mkdir -p $(prefix)/share/icons/hicolor/scalable/apps/
  49. - mkdir -p $(prefix)/share/$(name)/
  50. - mkdir -p $(prefix)/share/$(name)/Database/
  51. - mkdir -p $(prefix)/share/$(name)/Firmware/
  52. - mkdir -p $(prefix)/share/$(name)/Shaders/
  53. - cp out/$(name) $(prefix)/bin/$(name)
  54. - cp $(ui)/resource/$(name).desktop $(prefix)/share/applications/$(name).desktop
  55. - cp $(ui)/resource/$(name).png $(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  56. - cp $(ui)/resource/$(name).svg $(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  57. - cp Database/* $(prefix)/share/$(name)/Database/
  58. - cp -r ../shaders/* $(prefix)/share/$(name)/Shaders/
  59. + mkdir -p $(DESTDIR)$(prefix)/bin/
  60. + mkdir -p $(DESTDIR)$(prefix)/share/applications/
  61. + mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/
  62. + mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/
  63. + mkdir -p $(DESTDIR)$(prefix)/share/$(name)/
  64. + mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Database/
  65. + mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Firmware/
  66. + mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Shaders/
  67. + cp out/$(name) $(DESTDIR)$(prefix)/bin/$(name)
  68. + cp $(ui)/resource/$(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop
  69. + cp $(ui)/resource/$(name).png $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  70. + cp $(ui)/resource/$(name).svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  71. + cp Database/* $(DESTDIR)$(prefix)/share/$(name)/Database/
  72. + cp -r ../shaders/* $(DESTDIR)$(prefix)/share/$(name)/Shaders/
  73. endif
  74. uninstall:
  75. @@ -68,9 +68,9 @@ ifeq ($(platform),windows)
  76. else ifeq ($(platform),macos)
  77. rm -rf /Applications/$(name).app
  78. else ifneq ($(filter $(platform),linux bsd),)
  79. - rm -f $(prefix)/bin/$(name)
  80. - rm -f $(prefix)/share/applications/$(name).desktop
  81. - rm -f $(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  82. - rm -f $(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  83. - rm -rf $(prefix)/share/$(name)
  84. + rm -f $(DESTDIR)$(prefix)/bin/$(name)
  85. + rm -f $(DESTDIR)$(prefix)/share/applications/$(name).desktop
  86. + rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  87. + rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  88. + rm -rf $(DESTDIR)$(prefix)/share/$(name)
  89. endif
  90. --
  91. 2.29.2
  92. From 8965225ba1a501960ab9eacd2111ea90ce69913b Mon Sep 17 00:00:00 2001
  93. From: orbea <orbea@riseup.net>
  94. Date: Mon, 28 Dec 2020 10:35:47 -0800
  95. Subject: [PATCH 3/5] build: Follow FHS default paths.
  96. ---
  97. bsnes/target-bsnes/GNUmakefile | 37 +++++++++++++++++-----------------
  98. nall/GNUmakefile | 5 ++++-
  99. 2 files changed, 22 insertions(+), 20 deletions(-)
  100. diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
  101. index 3d7ceaf7..1a413a22 100644
  102. --- a/bsnes/target-bsnes/GNUmakefile
  103. +++ b/bsnes/target-bsnes/GNUmakefile
  104. @@ -47,20 +47,19 @@ else ifeq ($(platform),macos)
  105. mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
  106. cp -R out/$(name).app /Applications/$(name).app
  107. else ifneq ($(filter $(platform),linux bsd),)
  108. - mkdir -p $(DESTDIR)$(prefix)/bin/
  109. - mkdir -p $(DESTDIR)$(prefix)/share/applications/
  110. - mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/
  111. - mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/
  112. - mkdir -p $(DESTDIR)$(prefix)/share/$(name)/
  113. - mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Database/
  114. - mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Firmware/
  115. - mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Shaders/
  116. - cp out/$(name) $(DESTDIR)$(prefix)/bin/$(name)
  117. - cp $(ui)/resource/$(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop
  118. - cp $(ui)/resource/$(name).png $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  119. - cp $(ui)/resource/$(name).svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  120. - cp Database/* $(DESTDIR)$(prefix)/share/$(name)/Database/
  121. - cp -r ../shaders/* $(DESTDIR)$(prefix)/share/$(name)/Shaders/
  122. + mkdir -p $(DESTDIR)$(bindir)
  123. + mkdir -p $(DESTDIR)$(datarootdir)/applications
  124. + mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps
  125. + mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps
  126. + mkdir -p $(DESTDIR)$(datadir)/$(name)/Database
  127. + mkdir -p $(DESTDIR)$(datadir)/$(name)/Firmware
  128. + mkdir -p $(DESTDIR)$(datadir)/$(name)/Shaders
  129. + cp out/$(name) $(DESTDIR)$(bindir)/$(name)
  130. + cp $(ui)/resource/$(name).desktop $(DESTDIR)$(datarootdir)/applications/$(name).desktop
  131. + cp $(ui)/resource/$(name).png $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
  132. + cp $(ui)/resource/$(name).svg $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
  133. + cp Database/* $(DESTDIR)$(datadir)/$(name)/Database/
  134. + cp -r ../shaders/* $(DESTDIR)$(datadir)/$(name)/Shaders/
  135. endif
  136. uninstall:
  137. @@ -68,9 +67,9 @@ ifeq ($(platform),windows)
  138. else ifeq ($(platform),macos)
  139. rm -rf /Applications/$(name).app
  140. else ifneq ($(filter $(platform),linux bsd),)
  141. - rm -f $(DESTDIR)$(prefix)/bin/$(name)
  142. - rm -f $(DESTDIR)$(prefix)/share/applications/$(name).desktop
  143. - rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
  144. - rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
  145. - rm -rf $(DESTDIR)$(prefix)/share/$(name)
  146. + rm -f $(DESTDIR)$(bindir)/$(name)
  147. + rm -f $(DESTDIR)$(datarootdir)/applications/$(name).desktop
  148. + rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
  149. + rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
  150. + rm -rf $(DESTDIR)$(datadir)/$(name)
  151. endif
  152. diff --git a/nall/GNUmakefile b/nall/GNUmakefile
  153. index 0489910e..2a97fe0d 100755
  154. --- a/nall/GNUmakefile
  155. +++ b/nall/GNUmakefile
  156. @@ -246,5 +246,8 @@ strne = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),1,)
  157. ifeq ($(platform),windows)
  158. prefix := $(subst $([space]),\$([space]),$(strip $(call strtr,$(LOCALAPPDATA),\,/)))
  159. else
  160. - prefix := $(HOME)/.local
  161. + prefix ?= /usr/local
  162. + bindir ?= $(prefix)/bin
  163. + datarootdir ?= $(prefix)/share
  164. + datadir ?= $(datarootdir)
  165. endif
  166. --
  167. 2.29.2
  168. From 30b281c65de6a08132fa7ee956495747f4725097 Mon Sep 17 00:00:00 2001
  169. From: orbea <orbea@riseup.net>
  170. Date: Mon, 28 Dec 2020 10:57:28 -0800
  171. Subject: [PATCH 4/5] nall: Use the value of datadir to find the assets dir.
  172. ---
  173. nall/GNUmakefile | 1 +
  174. nall/path.hpp | 2 ++
  175. 2 files changed, 3 insertions(+)
  176. diff --git a/nall/GNUmakefile b/nall/GNUmakefile
  177. index 2a97fe0d..1587a427 100755
  178. --- a/nall/GNUmakefile
  179. +++ b/nall/GNUmakefile
  180. @@ -250,4 +250,5 @@ else
  181. bindir ?= $(prefix)/bin
  182. datarootdir ?= $(prefix)/share
  183. datadir ?= $(datarootdir)
  184. + flags += -DDATADIR=\"$(datadir)\"
  185. endif
  186. diff --git a/nall/path.hpp b/nall/path.hpp
  187. index 3353817b..a9f0b496 100644
  188. --- a/nall/path.hpp
  189. +++ b/nall/path.hpp
  190. @@ -137,6 +137,8 @@ inline auto sharedData() -> string {
  191. result.transform("\\", "/");
  192. #elif defined(PLATFORM_MACOS)
  193. string result = "/Library/Application Support/";
  194. + #elif defined(DATADIR)
  195. + string result = DATADIR;
  196. #else
  197. string result = "/usr/share/";
  198. #endif
  199. --
  200. 2.29.2
  201. From 45328b6732e37e06596732950563178d4b5fde5b Mon Sep 17 00:00:00 2001
  202. From: orbea <orbea@riseup.net>
  203. Date: Wed, 30 Dec 2020 14:02:38 -0800
  204. Subject: [PATCH 5/5] build: Allow out of tree builds.
  205. ---
  206. bsnes/GNUmakefile | 22 ++++++++++---------
  207. bsnes/gb/GNUmakefile | 40 +++++++++++++++++-----------------
  208. bsnes/processor/GNUmakefile | 14 ++++++------
  209. bsnes/sfc/GNUmakefile | 26 +++++++++++-----------
  210. bsnes/target-bsnes/GNUmakefile | 8 +++----
  211. hiro/GNUmakefile | 4 ++--
  212. nall/GNUmakefile | 10 +++++++++
  213. ruby/GNUmakefile | 2 +-
  214. 8 files changed, 69 insertions(+), 57 deletions(-)
  215. diff --git a/bsnes/GNUmakefile b/bsnes/GNUmakefile
  216. index 9450f39c..8a320cdf 100644
  217. --- a/bsnes/GNUmakefile
  218. +++ b/bsnes/GNUmakefile
  219. @@ -1,9 +1,11 @@
  220. +srcdir := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
  221. +
  222. target := bsnes
  223. binary := application
  224. build := performance
  225. openmp := true
  226. local := true
  227. -flags += -I. -I..
  228. +flags += -I$(srcdir)/. -I$(srcdir)/..
  229. # in order for this to work, obj/lzma.o must be omitted or bsnes will hang on startup.
  230. # further, only the X-Video driver works reliably. OpenGL 3.2, OpenGL 2.0, and XShm crash bsnes.
  231. @@ -17,7 +19,7 @@ ifeq ($(local),true)
  232. flags += -march=native
  233. endif
  234. -nall.path := ../nall
  235. +nall.path := $(srcdir)/../nall
  236. include $(nall.path)/GNUmakefile
  237. ifeq ($(platform),windows)
  238. @@ -46,16 +48,16 @@ endif
  239. objects := libco emulator filter lzma
  240. -obj/libco.o: ../libco/libco.c
  241. -obj/emulator.o: emulator/emulator.cpp
  242. -obj/filter.o: filter/filter.cpp
  243. -obj/lzma.o: lzma/lzma.cpp
  244. +obj/libco.o: $(srcdir)/../libco/libco.c maketree
  245. +obj/emulator.o: $(srcdir)/emulator/emulator.cpp maketree
  246. +obj/filter.o: $(srcdir)/filter/filter.cpp maketree
  247. +obj/lzma.o: $(srcdir)/lzma/lzma.cpp maketree
  248. -include sfc/GNUmakefile
  249. -include gb/GNUmakefile
  250. -include processor/GNUmakefile
  251. +include $(srcdir)/sfc/GNUmakefile
  252. +include $(srcdir)/gb/GNUmakefile
  253. +include $(srcdir)/processor/GNUmakefile
  254. -ui := target-$(target)
  255. +ui := $(srcdir)/target-$(target)
  256. include $(ui)/GNUmakefile
  257. -include obj/*.d
  258. diff --git a/bsnes/gb/GNUmakefile b/bsnes/gb/GNUmakefile
  259. index e88ac418..b3ee9e93 100644
  260. --- a/bsnes/gb/GNUmakefile
  261. +++ b/bsnes/gb/GNUmakefile
  262. @@ -1,29 +1,29 @@
  263. -include gb/version.mk
  264. +include $(srcdir)/gb/version.mk
  265. export VERSION
  266. flags += -DGB_INTERNAL -DGB_DISABLE_DEBUGGER -DGB_DISABLE_CHEATS -D_GNU_SOURCE -DGB_VERSION=\"$(VERSION)\" -Wno-multichar
  267. -options += -I../sameboy
  268. +options += -I$(srcdir)/../sameboy
  269. objects += gb-apu gb-camera gb-rumble gb-display gb-gb gb-joypad gb-mbc
  270. objects += gb-memory gb-printer gb-random gb-rewind gb-save_state gb-sgb
  271. objects += gb-sm83_cpu gb-symbol_hash gb-timing
  272. #objects+= gb-debugger gb-sm83_disassembler
  273. -obj/gb-apu.o: gb/Core/apu.c
  274. -obj/gb-camera.o: gb/Core/camera.c
  275. -obj/gb-debugger.o: gb/Core/debugger.c
  276. -obj/gb-rumble.o: gb/Core/rumble.c
  277. -obj/gb-display.o: gb/Core/display.c
  278. -obj/gb-gb.o: gb/Core/gb.c
  279. -obj/gb-joypad.o: gb/Core/joypad.c
  280. -obj/gb-mbc.o: gb/Core/mbc.c
  281. -obj/gb-memory.o: gb/Core/memory.c
  282. -obj/gb-printer.o: gb/Core/printer.c
  283. -obj/gb-random.o: gb/Core/random.c
  284. -obj/gb-rewind.o: gb/Core/rewind.c
  285. -obj/gb-save_state.o: gb/Core/save_state.c
  286. -obj/gb-sgb.o: gb/Core/sgb.c
  287. -obj/gb-sm83_cpu.o: gb/Core/sm83_cpu.c
  288. -obj/gb-sm83_disassembler.o: gb/Core/sm83_disassembler.c
  289. -obj/gb-symbol_hash.o: gb/Core/symbol_hash.c
  290. -obj/gb-timing.o: gb/Core/timing.c
  291. +obj/gb-apu.o: $(srcdir)/gb/Core/apu.c
  292. +obj/gb-camera.o: $(srcdir)/gb/Core/camera.c
  293. +obj/gb-debugger.o: $(srcdir)/gb/Core/debugger.c
  294. +obj/gb-rumble.o: $(srcdir)/gb/Core/rumble.c
  295. +obj/gb-display.o: $(srcdir)/gb/Core/display.c
  296. +obj/gb-gb.o: $(srcdir)/gb/Core/gb.c
  297. +obj/gb-joypad.o: $(srcdir)/gb/Core/joypad.c
  298. +obj/gb-mbc.o: $(srcdir)/gb/Core/mbc.c
  299. +obj/gb-memory.o: $(srcdir)/gb/Core/memory.c
  300. +obj/gb-printer.o: $(srcdir)/gb/Core/printer.c
  301. +obj/gb-random.o: $(srcdir)/gb/Core/random.c
  302. +obj/gb-rewind.o: $(srcdir)/gb/Core/rewind.c
  303. +obj/gb-save_state.o: $(srcdir)/gb/Core/save_state.c
  304. +obj/gb-sgb.o: $(srcdir)/gb/Core/sgb.c
  305. +obj/gb-sm83_cpu.o: $(srcdir)/gb/Core/sm83_cpu.c
  306. +obj/gb-sm83_disassembler.o: $(srcdir)/gb/Core/sm83_disassembler.c
  307. +obj/gb-symbol_hash.o: $(srcdir)/gb/Core/symbol_hash.c
  308. +obj/gb-timing.o: $(srcdir)/gb/Core/timing.c
  309. diff --git a/bsnes/processor/GNUmakefile b/bsnes/processor/GNUmakefile
  310. index e8928ebf..5dda56ca 100644
  311. --- a/bsnes/processor/GNUmakefile
  312. +++ b/bsnes/processor/GNUmakefile
  313. @@ -8,10 +8,10 @@ objects += $(if $(findstring spc700,$(processors)),processor-spc700)
  314. objects += $(if $(findstring upd96050,$(processors)),processor-upd96050)
  315. objects += $(if $(findstring wdc65816,$(processors)),processor-wdc65816)
  316. -obj/processor-arm7tdmi.o: processor/arm7tdmi/arm7tdmi.cpp
  317. -obj/processor-gsu.o: processor/gsu/gsu.cpp
  318. -obj/processor-hg51b.o: processor/hg51b/hg51b.cpp
  319. -obj/processor-sm83.o: processor/sm83/sm83.cpp
  320. -obj/processor-spc700.o: processor/spc700/spc700.cpp
  321. -obj/processor-upd96050.o: processor/upd96050/upd96050.cpp
  322. -obj/processor-wdc65816.o: processor/wdc65816/wdc65816.cpp
  323. +obj/processor-arm7tdmi.o: $(srcdir)/processor/arm7tdmi/arm7tdmi.cpp
  324. +obj/processor-gsu.o: $(srcdir)/processor/gsu/gsu.cpp
  325. +obj/processor-hg51b.o: $(srcdir)/processor/hg51b/hg51b.cpp
  326. +obj/processor-sm83.o: $(srcdir)/processor/sm83/sm83.cpp
  327. +obj/processor-spc700.o: $(srcdir)/processor/spc700/spc700.cpp
  328. +obj/processor-upd96050.o: $(srcdir)/processor/upd96050/upd96050.cpp
  329. +obj/processor-wdc65816.o: $(srcdir)/processor/wdc65816/wdc65816.cpp
  330. diff --git a/bsnes/sfc/GNUmakefile b/bsnes/sfc/GNUmakefile
  331. index 3bbd7483..1eedfae2 100644
  332. --- a/bsnes/sfc/GNUmakefile
  333. +++ b/bsnes/sfc/GNUmakefile
  334. @@ -5,18 +5,18 @@ objects += sfc-cartridge sfc-memory
  335. objects += sfc-cpu sfc-smp sfc-dsp sfc-ppu sfc-ppu-fast
  336. objects += sfc-expansion sfc-coprocessor sfc-slot
  337. -obj/sfc-interface.o: sfc/interface/interface.cpp
  338. -obj/sfc-system.o: sfc/system/system.cpp
  339. -obj/sfc-controller.o: sfc/controller/controller.cpp
  340. -obj/sfc-cartridge.o: sfc/cartridge/cartridge.cpp
  341. -obj/sfc-memory.o: sfc/memory/memory.cpp
  342. +obj/sfc-interface.o: $(srcdir)/sfc/interface/interface.cpp maketree
  343. +obj/sfc-system.o: $(srcdir)/sfc/system/system.cpp maketree
  344. +obj/sfc-controller.o: $(srcdir)/sfc/controller/controller.cpp maketree
  345. +obj/sfc-cartridge.o: $(srcdir)/sfc/cartridge/cartridge.cpp maketree
  346. +obj/sfc-memory.o: $(srcdir)/sfc/memory/memory.cpp maketree
  347. -obj/sfc-cpu.o: sfc/cpu/cpu.cpp
  348. -obj/sfc-smp.o: sfc/smp/smp.cpp
  349. -obj/sfc-dsp.o: sfc/dsp/dsp.cpp
  350. -obj/sfc-ppu.o: sfc/ppu/ppu.cpp
  351. -obj/sfc-ppu-fast.o: sfc/ppu-fast/ppu.cpp
  352. +obj/sfc-cpu.o: $(srcdir)/sfc/cpu/cpu.cpp maketree
  353. +obj/sfc-smp.o: $(srcdir)/sfc/smp/smp.cpp maketree
  354. +obj/sfc-dsp.o: $(srcdir)/sfc/dsp/dsp.cpp maketree
  355. +obj/sfc-ppu.o: $(srcdir)/sfc/ppu/ppu.cpp maketree
  356. +obj/sfc-ppu-fast.o: $(srcdir)/sfc/ppu-fast/ppu.cpp maketree
  357. -obj/sfc-expansion.o: sfc/expansion/expansion.cpp
  358. -obj/sfc-coprocessor.o: sfc/coprocessor/coprocessor.cpp
  359. -obj/sfc-slot.o: sfc/slot/slot.cpp
  360. +obj/sfc-expansion.o: $(srcdir)/sfc/expansion/expansion.cpp maketree
  361. +obj/sfc-coprocessor.o: $(srcdir)/sfc/coprocessor/coprocessor.cpp maketree
  362. +obj/sfc-slot.o: $(srcdir)/sfc/slot/slot.cpp maketree
  363. diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
  364. index 1a413a22..44af4a4d 100644
  365. --- a/bsnes/target-bsnes/GNUmakefile
  366. +++ b/bsnes/target-bsnes/GNUmakefile
  367. @@ -1,10 +1,10 @@
  368. name := bsnes
  369. -hiro.path := ../hiro
  370. +hiro.path := $(srcdir)/../hiro
  371. hiro.resource := $(ui)/resource/bsnes.rc
  372. include $(hiro.path)/GNUmakefile
  373. -ruby.path := ../ruby
  374. +ruby.path := $(srcdir)/../ruby
  375. include $(ruby.path)/GNUmakefile
  376. objects += ui-bsnes ui-program ui-input ui-presentation
  377. @@ -58,8 +58,8 @@ else ifneq ($(filter $(platform),linux bsd),)
  378. cp $(ui)/resource/$(name).desktop $(DESTDIR)$(datarootdir)/applications/$(name).desktop
  379. cp $(ui)/resource/$(name).png $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
  380. cp $(ui)/resource/$(name).svg $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
  381. - cp Database/* $(DESTDIR)$(datadir)/$(name)/Database/
  382. - cp -r ../shaders/* $(DESTDIR)$(datadir)/$(name)/Shaders/
  383. + cp $(srcdir)/Database/* $(DESTDIR)$(datadir)/$(name)/Database/
  384. + cp -r $(srcdir)/../shaders/* $(DESTDIR)$(datadir)/$(name)/Shaders/
  385. endif
  386. uninstall:
  387. diff --git a/hiro/GNUmakefile b/hiro/GNUmakefile
  388. index 94736db5..4d8d4c7f 100755
  389. --- a/hiro/GNUmakefile
  390. +++ b/hiro/GNUmakefile
  391. @@ -78,13 +78,13 @@ hiro.objects := \
  392. $(object.path)/hiro-$(hiro).o \
  393. $(if $(filter windows,$(hiro)),$(object.path)/hiro-resource.o)
  394. -$(object.path)/hiro-$(hiro).o: $(hiro.path)/hiro.cpp
  395. +$(object.path)/hiro-$(hiro).o: $(hiro.path)/hiro.cpp maketree
  396. $(if $(filter qt%,$(hiro)),$(info Compiling $(hiro.path)/qt/qt.moc ...))
  397. $(if $(filter qt%,$(hiro)),@$(moc) -i -o $(hiro.path)/qt/qt.moc $(hiro.path)/qt/qt.hpp)
  398. $(info Compiling $(subst ../,,$<) ...)
  399. @$(compiler) $(hiro.flags) $(flags) $(flags.deps) -c $< -o $@
  400. -$(object.path)/hiro-resource.o: $(hiro.resource)
  401. +$(object.path)/hiro-resource.o: $(hiro.resource) maketree
  402. $(info Compiling $(subst ../,,$<) ...)
  403. @$(windres) $< $@
  404. diff --git a/nall/GNUmakefile b/nall/GNUmakefile
  405. index 1587a427..f9becd52 100755
  406. --- a/nall/GNUmakefile
  407. +++ b/nall/GNUmakefile
  408. @@ -162,6 +162,16 @@ endif
  409. # rules
  410. default: all;
  411. +maketree: $(object.path)/.tag out/.tag
  412. +
  413. +$(object.path)/.tag:
  414. + @mkdir -p obj
  415. + @touch $@
  416. +
  417. +out/.tag:
  418. + @mkdir -p out
  419. + @touch $@
  420. +
  421. nall.verbose:
  422. $(info Compiler Flags:)
  423. $(foreach n,$(sort $(call unique,$(flags))),$(if $(filter-out -I%,$n),$(info $([space]) $n)))
  424. diff --git a/ruby/GNUmakefile b/ruby/GNUmakefile
  425. index 289bc530..0b79295f 100755
  426. --- a/ruby/GNUmakefile
  427. +++ b/ruby/GNUmakefile
  428. @@ -91,7 +91,7 @@ endif
  429. ruby.objects := $(object.path)/ruby.o
  430. -$(object.path)/ruby.o: $(ruby.path)/ruby.cpp $(call rwildcard,$(ruby.path))
  431. +$(object.path)/ruby.o: $(ruby.path)/ruby.cpp $(call rwildcard,$(ruby.path)) maketree
  432. $(info Compiling $< ...)
  433. @$(compiler) $(ruby.flags) $(flags) $(flags.deps) -c $< -o $@
  434. --
  435. 2.29.2