File: gnustep_app_builder.diff

package info (click to toggle)
oolite 1.84-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 124,644 kB
  • ctags: 3,975
  • sloc: objc: 132,132; ansic: 3,138; sh: 559; perl: 359; makefile: 276; php: 5
file content (120 lines) | stat: -rw-r--r-- 4,562 bytes parent folder | 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
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
117
118
119
120
Author: Nicolas Boulenguez <nicolas@debian.org>
Description: use GNUstep application builder
 This cosmetic patch is commented in patches/series as long as it
 triggers 732377: save menu inoperant, log contains
 dataCache.cantWrite and NSInvalidArgumentException.
 .
 Quoting /usr/share/GNUstep/Makefiles/objc.make, "objc.make is deprecated".
 Moreover, application.make provides support for
 - resource embedding via the xxx_RESOURCE_FILE variable,
   allowing to simplify a lot GNUmakefile.postamble.
 - on-the-fly creation of Resources/Info-gnustep.plist and
   Resources/oolite.desktop.
 .
 The generated desktop file does not compare to a hand-written one,
 but the info plist merges the content of ooliteInfo.plist if present in the
 top directory. Moving or linking src/Cocoa/Info-Oolite.plist
 to ooliteInfo.plist will allow to remove more lines from
 GNUmakefile.postamble.
 .
 Answer from Chris Morris <cim@oolite.org>:
 Moving to application.make is a good thing - but this unfortunately makes
 the file less useful for developing Oolite. The old file you could
 separately build debug and release targets, and they'd save compiled objects
 to different subfolders, so you didn't have to do a "make clean" before
 switching between release and debug builds, and building a debug build
 wouldn't wipe the release executable.

--- a/GNUmakefile
+++ b/GNUmakefile
@@ -144,7 +144,18 @@
     ADDITIONAL_OBJCFLAGS         += -DSNAPSHOT_BUILD -DOOLITE_SNAPSHOT_VERSION=\"$(VERSION_STRING)\"
 endif
 
-OBJC_PROGRAM_NAME = oolite
+APP_NAME = oolite
+
+oolite_RESOURCE_FILES := \
+    $(wildcard Resources/*) \
+    Schemata
+ifeq ($(ESPEAK),yes)
+    ifeq ($(GNUSTEP_HOST_OS),mingw32)
+        oolite_RESOURCE_FILES += deps/Cross-platform-deps/espeak-data
+    else ifeq ($(use_deps),yes)
+        oolite_RESOURCE_FILES += deps/Cross-platform-deps/espeak-data
+    endif
+endif
 
 oolite_C_FILES = \
     legacy_random.c \
@@ -424,5 +435,5 @@
     $(OO_UTILITY_FILES) \
     $(OOLITE_MISC_FILES)
 
-include $(GNUSTEP_MAKEFILES)/objc.make
+include $(GNUSTEP_MAKEFILES)/application.make
 include GNUmakefile.postamble
--- a/GNUmakefile.postamble
+++ b/GNUmakefile.postamble
@@ -5,10 +5,6 @@
 #
 CP_FLAGS                         = -rf
 
-ifeq ($(debug),yes)
-    EXT                          =.dbg
-endif
-                                 
 ifeq ($(findstring -gnu,$(GNUSTEP_HOST_OS)),-gnu)
     CP_FLAGS                     += -u
 endif
@@ -18,43 +14,17 @@
     CP_FLAGS                     += -u
 endif
 
-SRC_BIN                          = $(OBJC_PROGRAM_NAME)$(OS_EXT)
-DEST_BIN                         = $(OBJC_PROGRAM_NAME)$(EXT)$(OS_EXT)
-
-MKMANIFEST=tools/mkmanifest.sh
-
-PROGDIR=$(OBJC_PROGRAM_NAME).app
+PROGDIR=$(APP_NAME).app
 
 after-all::
-	$(MKDIRS) $(PROGDIR)
-	$(MKDIRS) $(PROGDIR)/Resources
-	$(MKMANIFEST) > $(PROGDIR)/Resources/manifest.plist
-	$(CP) $(CP_FLAGS) Resources/README.TXT $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/InfoPlist.strings $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/AIs $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Config $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Scenarios $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Scripts $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Shaders $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Binary/Images $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Binary/Models $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Binary/Music $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Binary/Sounds $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Resources/Binary/Textures $(PROGDIR)/Resources
-	$(CP) $(CP_FLAGS) Schemata $(PROGDIR)/Resources
-ifeq ($(ESPEAK),yes)
-    ifeq ($(GNUSTEP_HOST_OS),mingw32)
-		$(CP) $(CP_FLAGS) deps/Cross-platform-deps/espeak-data $(PROGDIR)/Resources
-    else
-        ifeq ($(use_deps),yes)
-			$(CP) $(CP_FLAGS) deps/Cross-platform-deps/espeak-data $(PROGDIR)/Resources
-        endif
-    endif
-endif
+	# Replace some poorly generated files with hand-crafted ones.
+	$(CP) $(CP_FLAGS) installers/FreeDesktop/oolite.desktop $(PROGDIR)/Resources/oolite.desktop
 	$(CP) $(CP_FLAGS) src/Cocoa/Info-Oolite.plist $(PROGDIR)/Resources/Info-gnustep.plist
-	$(CP) $(CP_FLAGS) $(GNUSTEP_OBJ_DIR_NAME)/$(SRC_BIN) $(PROGDIR)/$(DEST_BIN)
+ifeq ($(debug),yes)
+	mv $(PROGDIR)/$(APP_NAME)$(OS_EXT) $(PROGDIR)/$(APP_NAME).dbg$(OS_EXT)
+endif
 ifeq ($(strip),yes)
-	$(STRIP) $(PROGDIR)/$(DEST_BIN)
+	$(STRIP) $(PROGDIR)/$(APP_NAME)$(OS_EXT)
 endif
 ifeq ($(GNUSTEP_HOST_OS),mingw32)
     ifeq ($(GNUSTEP_HOST_CPU),x86_64)