summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/msvc/Makefile
blob: 3c1d6a0f36e12c5e9807d041269154b20ba67ebc (plain)
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
#             __________               __   ___.
#   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
#   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
#   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
#   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
#

ifndef V
SILENT = @
endif
# The rbspeex Makefile has problems with msys' path mangling as well as running
# MSVC's lib tool.  Use TOP instead of pwd. This means the resulting files will
# always be placed in this folder.
# On Linux use the current folder instead.
TOP := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

LIBS = ipodpatcher sansapatcher chinachippatcher \
       mkamsboot mkimxboot mkmpioboot mktccboot \
       ucl rbspeex

ifeq ($(findstring Linux,$(shell uname)),Linux)
PWD=$(shell pwd)
all: dll
else
PWD=$(abspath $(TOP))
all: lib
endif

CC=gcc
dll: $(addsuffix .dll,$(LIBS))

ucl.dll:
	$(SILENT)$(MAKE) -C ../../../tools/ucl/src \
	    TARGET_DIR=$(PWD)/ OBJDIR=$(PWD)/build-dll/$(basename $@) \
	    CROSS=$(CROSS) CC=$(CC) APPVERSION=dll dll
rbspeex.dll:
	$(SILENT)$(MAKE) -C ../../../tools/rbspeex \
	    TARGET_DIR=$(PWD)/ BUILD_DIR=$(PWD)/build-dll/$(basename $@) \
	    CROSS=$(CROSS) CC=$(CC) STATIC=1 APPVERSION=dll dll

%.dll:
	$(SILENT)$(MAKE) -C ../../$(basename $@) \
	    TARGET_DIR=$(PWD)/ BUILD_DIR=$(PWD)/build-dll/$(basename $@) \
	    CROSS=$(CROSS) CC=$(CC) APPVERSION=dll dll

lib: $(addsuffix .lib,$(LIBS))

%.lib: %.dll
	@echo LIB $@
	@lib /machine:x86 /nologo /def:$(basename $<).def

clean:
	rm -rf $(addsuffix .dll,$(LIBS))
	rm -rf $(addsuffix .def,$(LIBS))
	rm -rf $(addsuffix .exp,$(LIBS))
	rm -rf $(addsuffix .lib,$(LIBS))
	rm -rf build-dll