summaryrefslogtreecommitdiff
path: root/pkg/osx/GNUmakefile
blob: 82c353fe465824e987dcbe3304bcf2e2a59ffc70 (plain)
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
include config.make

STAGING_DIR=staging
DMG=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).dmg
DOC_FILES=\
        README       \
        COPYING      \
        ChangeLog    \
        NEWS         \
        BUGS         \
        CMDLINE      \
        TODO

ifndef GNUSTEP_MAKEFILES

# DMG file containing package:

$(DMG) : $(STAGING_DIR)
	rm -f $@
	hdiutil create -volname "$(PACKAGE_STRING)" -srcdir $(STAGING_DIR) $@

endif

# Staging dir build for package:

APP_DIR=$(STAGING_DIR)/$(PACKAGE_NAME).app

$(STAGING_DIR): launcher
	rm -rf $(STAGING_DIR)
	mkdir $(STAGING_DIR)
	cp -R app-skeleton "$(APP_DIR)"
	cp Info.plist "$(APP_DIR)/Contents/"
	cp launcher "$(APP_DIR)/Contents/MacOS/"
	# TODO: copy Doom and setup binaries into app dir
	for d in $(DOC_FILES); do cp ../../$$d $(STAGING_DIR)/; done
	find $(STAGING_DIR) -name .svn -delete -exec rm -rf {} \; || true

clean : launcher_clean
	rm -f $(DMG)
	rm -rf $(STAGING_DIR)

# Launcher build:

CFLAGS = -Wall -I../..

# Are we building using gs_make?

ifdef GNUSTEP_MAKEFILES
CFLAGS += $(shell gnustep-config --objc-flags)
LDFLAGS = $(shell gnustep-config --gui-libs)
else
LDFLAGS = -framework Cocoa
endif

LAUNCHER_OBJS= \
        AppController.o \
        Execute.o \
        IWADController.o \
        IWADLocation.o \
        LauncherManager.o \
        main.o

launcher : $(LAUNCHER_OBJS)
	$(CC) $(LDFLAGS) $(LAUNCHER_OBJS) -o $@

%.o : %.m
	$(CC) -c $(CFLAGS) $^ -o $@

launcher_clean :
	rm -f $(LAUNCHER_OBJS) launcher