move all explorer plugin files into subdirectory
[git-cheetah/kirill.git] / explorer / Makefile
blob14db3161417c6986d99080a7c1c520a6b57dc44d
1 MODULES=ext.c dll.c factory.c menu.c systeminfo.c registry.c \
2 columns.c
3 OBJECTS=${MODULES:%.c=%.o}
4 COMMON_OBJ = ../common/cheetahmenu.o ../common/date.o ../common/debug.o \
5 ../common/exec.o ../common/menuengine.o \
6 ../common/sha1_file.o ../common/strbuf.o \
7 ../common/usage.o ../common/wrapper.o
8 COMPAT_OBJ = ../compat/mingw.o ../compat/mmap.o ../compat/pread.o \
9 ../compat/strlcpy.o ../compat/winansi.o
11 ifeq ($(shell uname -o 2>/dev/null), Cygwin)
12 OSCFLAGS =-mno-cygwin -mwin32 -mdll
13 OSDLLWRAPFLAG =-mno-cygwin --target=i386-mingw32
14 endif
16 # define _WIN32_IE, so IColumnProvider's structures are available
17 CFLAGS=-O -g -DNO_MMAP -DNO_PREAD -DNO_STRLCPY -D_WIN32_IE=0x0500 $(OSCFLAGS)
18 DLLWRAPFLAGS = -Wl,--enable-stdcall-fixup $(OSDLLWRAPFLAG)
20 TARGET=git_shell_ext.dll
21 MSYSGIT_PATH=$(shell cd /; pwd -W | sed -e 's|/|\\\\\\\\|g')
22 DLL_PATH=$(shell pwd -W | sed -e 's|/|\\\\\\\\|g')\\\\$(TARGET)
24 # export compile flags to sub-make of the common folder
25 export CFLAGS
27 all: $(TARGET)
29 common-obj:
30 $(MAKE) -C ../common all
32 %.o : %.c
33 $(CC) $(CFLAGS) $< -c -o $@
35 deps: $(MODULES)
36 $(CC) $(CFLAGS) -MM $(MODULES) > deps
38 $(TARGET): common-obj $(OBJECTS) $(COMPAT_OBJ) deps git_shell_ext.def
39 dllwrap.exe $(DLLWRAPFLAGS) --def git_shell_ext.def \
40 $(COMMON_OBJ) $(OBJECTS) $(COMPAT_OBJ) -o $@ \
41 -luuid -loleaut32 -lole32 -lws2_32
43 # gcc $(LDFLAGS) -o $@ $(OBJECTS) -lole32 -luuid -loleaut32
44 # dlltool -d git_shell_ext.def -l $@ $(OBJECTS)
46 -include deps
48 install: all
49 regsvr32 -s -n -i:machine $(DLL_PATH)
51 uninstall: all
52 regsvr32 -u -s -n -i:machine $(DLL_PATH)
54 install-user: all
55 regsvr32 -s $(DLL_PATH)
57 uninstall-user: all
58 regsvr32 -u -s $(DLL_PATH)
60 clean:
61 -rm -f $(OBJECTS) $(COMPAT_OBJ) $(TARGET) deps
62 $(MAKE) -C ../common clean