implement git-cheetah plugin for Finder on Mac OS X
[git-cheetah/kirill.git] / finder / Makefile
blob66f490964d6999b0c3406f50cc2e451ab1592c57
1 CFLAGS = -g -pedantic -Wall -std=c99
2 TARGET = git-cheetah
3 MODULES = menu.c util.c plugin.c ../compat/posix.c
5 OBJECTS=${MODULES:%.c=%.o}
7 COMMON_OBJ = ../common/cheetahmenu.o ../common/date.o ../common/debug.o \
8 ../common/exec.o ../common/menuengine.o \
9 ../common/sha1_file.o ../common/strbuf.o \
10 ../common/usage.o ../common/wrapper.o
12 all: $(TARGET).plugin
14 common-obj:
15 $(MAKE) -C ../common all
17 %.o : %.c
18 $(CC) $(CFLAGS) $< -c -o $@
20 deps: $(MODULES)
21 $(CC) $(CFLAGS) -MM $(MODULES) > deps
23 $(TARGET): $(OBJECTS) common-obj
24 gcc $(OBJECTS) $(COMMON_OBJ) \
25 -framework CoreFoundation \
26 -framework ApplicationServices \
27 -framework Carbon \
28 -bundle -o git-cheetah
30 $(TARGET).plugin: $(TARGET).plugin/Contents/MacOS/$(TARGET)
32 $(TARGET).plugin/Contents/MacOS/$(TARGET): $(TARGET) \
33 $(TARGET).plugin/Contents
34 mkdir -p $(TARGET).plugin/Contents/MacOS
35 cp $(TARGET) $(TARGET).plugin/Contents/MacOS/
37 $(TARGET).plugin/Contents: PkgInfo Info.plist
38 mkdir -p $(TARGET).plugin/Contents
39 cp PkgInfo $(TARGET).plugin/Contents/
40 cp Info.plist $(TARGET).plugin/Contents/
42 -include deps
44 install: all
45 rm -rf ~/Library/Contextual\ Menu\ Items/$(TARGET).plugin
46 cp -r $(TARGET).plugin ~/Library/Contextual\ Menu\ Items/$(TARGET).plugin
48 clean:
49 -rm -f $(OBJECTS) $(TARGET) deps
50 -rm -rf $(TARGET).plugin
51 $(MAKE) -C ../common clean