forked from shabble/mouseterm
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
91 lines (77 loc) · 2.52 KB
/
Makefile
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
CC=gcc
LD=$(CC)
ARCH=
ARCHES=$(foreach arch,$(ARCH),-arch $(arch))
OSXVER=10.5
OSXVER64=10.5
ifneq ($(OSXVER),$(OSXVER64))
ARCHES+=-Xarch_x86_64 -mmacosx-version-min=$(OSXVER64)
endif
OPTLEVEL=2
CFLAGS+=-std=c99 -O$(OPTLEVEL) -Wall -mmacosx-version-min=$(OSXVER) $(ARCHES)
LDFLAGS+=-bundle -laprutil-1 -lapr-1 -framework Cocoa
OBJS=JRSwizzle.o MouseTerm.m MTAppPrefsController.o MTParser.o \
MTProfile.o MTShell.o \
MTTabController.o MTView.o MTWindowController.o
NAME=MouseTerm
BUNDLE=$(NAME).bundle
DMG=$(NAME).dmg
TARGET=$(BUNDLE)/Contents/MacOS/$(NAME)
DMGFILES=$(BUNDLE) LICENSE.txt
SIMBLDIR=$(HOME)/Library/Application\ Support/SIMBL/Plugins
TERMINALAPP=/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
default: all
%.o: %.m
$(CC) -c $(CFLAGS) $< -o $@
$(TARGET): $(OBJS)
mkdir -p $(BUNDLE)/Contents/MacOS
$(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^
cp Info.plist $(BUNDLE)/Contents
mkdir -p $(BUNDLE)/Contents/Resources
cp -R *.lproj $(BUNDLE)/Contents/Resources
rm -f $(BUNDLE)/Contents/Resources/English.lproj/*.xib
ibtool --errors --warnings --notices \
--output-format human-readable-text --compile \
$(BUNDLE)/Contents/Resources/English.lproj/Configuration.nib \
English.lproj/Configuration.xib
rm -f $(BUNDLE)/Contents/Resources/Japanese.lproj/*.xib
ibtool --errors --warnings --notices \
--output-format human-readable-text --compile \
$(BUNDLE)/Contents/Resources/Japanese.lproj/Configuration.nib \
English.lproj/Configuration.xib
rm -f $(BUNDLE)/Contents/Resources/French.lproj/*.xib
ibtool --errors --warnings --notices \
--output-format human-readable-text --compile \
$(BUNDLE)/Contents/Resources/French.lproj/Configuration.nib \
English.lproj/Configuration.xib
all: $(TARGET)
dist: $(TARGET)
all: $(TARGET)
dist: $(TARGET)
rm -rf $(NAME) $(DMG)
mkdir -p $(NAME)/src
osacompile -o $(NAME)/Install.app Install.scpt
osacompile -o $(NAME)/Uninstall.app Uninstall.scpt
cp -R $(DMGFILES) $(NAME)
cp README.md $(NAME)/README.txt
cp -rf Makefile *.h *.m *.lproj *.md *.plist *.scpt *.txt utils \
$(NAME)/src
hdiutil create -fs HFS+ -imagekey zlib-level=9 -srcfolder $(NAME) \
-volname $(NAME) $(DMG)
rm -rf $(NAME)
clean:
rm -f *.o
rm -rf $(BUNDLE) $(NAME)
rm -f $(DMG) Terminal.classdump Terminal.otx
install: $(TARGET) uninstall
mkdir -p $(SIMBLDIR)
cp -R $(BUNDLE) $(SIMBLDIR)
uninstall:
rm -rf $(SIMBLDIR)/$(BUNDLE)
test: install
$(TERMINALAPP)
classdump:
class-dump $(TERMINALAPP) > Terminal.classdump
otx:
otx $(TERMINALAPP) > Terminal.otx
.PHONY: all dist clean install test classdump otx