-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (47 loc) · 1.25 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
CC=gcc
LD=gcc
ARCH=
ARCHES=$(foreach arch,$(ARCH),-arch $(arch))
OSXVER=10.4
OSXVER64=10.5
ifneq ($(OSXVER),$(OSXVER64))
ARCHES+=-Xarch_x86_64 -mmacosx-version-min=$(OSXVER64)
endif
CFLAGS+=-O2 -Wall -mmacosx-version-min=$(OSXVER) $(ARCHES)
LDFLAGS+=-bundle -framework Cocoa
OBJS=BounceTerm.m
NAME=BounceTerm
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
%.o: %.m
$(CC) -c $(CFLAGS) $< -o $@
$(TARGET): $(OBJS)
mkdir -p $(BUNDLE)/Contents/MacOS
$(LD) $(CFLAGS) $(LDFLAGS) -o $@ $^
cp Info.plist $(BUNDLE)/Contents
all: $(TARGET)
dist: $(TARGET)
rm -rf $(NAME) $(DMG)
mkdir $(NAME)
osacompile -o $(NAME)/Install.app Install.scpt
osacompile -o $(NAME)/Uninstall.app Uninstall.scpt
cp -R $(DMGFILES) $(NAME)
cp README.md $(NAME)/README.txt
hdiutil create -fs HFS+ -imagekey zlib-level=9 -srcfolder $(NAME) \
-volname $(NAME) $(DMG)
rm -rf $(NAME)
clean:
rm -f *.o
rm -rf $(BUNDLE)
rm -f $(DMG)
install: $(TARGET)
mkdir -p $(SIMBLDIR)
rm -rf $(SIMBLDIR)/$(BUNDLE)
cp -R $(BUNDLE) $(SIMBLDIR)
test: install
$(TERMINALAPP)
.PHONY: all dist clean install test