fix dll.h: do not instantiate just declare variables
[git-cheetah/kirill.git] / explorer / Makefile
blobb97a8d9f27bedda6c217c9c0813b3bfc36ac7f8f
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 DLL_PATH=$(shell cygpath -w "`pwd`" | sed -e 's|\\|\\\\\\\\|g')\\\\$(TARGET)
15 else
16 DLL_PATH=$(shell pwd -W | sed -e 's|/|\\\\\\\\|g')\\\\$(TARGET)
17 endif
19 # define _WIN32_IE, so IColumnProvider's structures are available
20 CFLAGS=-O -g -DNO_MMAP -DNO_PREAD -DNO_STRLCPY -D_WIN32_IE=0x0500 $(OSCFLAGS)
21 DLLWRAPFLAGS = -Wl,--enable-stdcall-fixup $(OSDLLWRAPFLAG)
23 TARGET=git_shell_ext.dll
24 MSYSGIT_PATH=$(shell cd /; pwd -W | sed -e 's|/|\\\\\\\\|g')
26 # export compile flags to sub-make of the common folder
27 export CFLAGS
29 all: $(TARGET)
31 common-obj:
32 $(MAKE) -C ../common all
34 %.o : %.c
35 $(CC) $(CFLAGS) $< -c -o $@
37 deps: $(MODULES)
38 $(CC) $(CFLAGS) -MM $(MODULES) > deps
40 $(TARGET): common-obj $(OBJECTS) $(COMPAT_OBJ) deps git_shell_ext.def
41 dllwrap.exe $(DLLWRAPFLAGS) --def git_shell_ext.def \
42 $(COMMON_OBJ) $(OBJECTS) $(COMPAT_OBJ) -o $@ \
43 -luuid -loleaut32 -lole32 -lws2_32
45 # gcc $(LDFLAGS) -o $@ $(OBJECTS) -lole32 -luuid -loleaut32
46 # dlltool -d git_shell_ext.def -l $@ $(OBJECTS)
48 -include deps
50 install: all
51 regsvr32 -s -n -i:machine $(DLL_PATH)
53 uninstall: all
54 regsvr32 -u -s -n -i:machine $(DLL_PATH)
56 install-user: all
57 regsvr32 -s $(DLL_PATH)
59 uninstall-user: all
60 regsvr32 -u -s $(DLL_PATH)
62 clean:
63 -rm -f $(OBJECTS) $(COMPAT_OBJ) $(TARGET) deps
64 $(MAKE) -C ../common clean