~ubuntu-branches/ubuntu/natty/x264/natty

« back to all changes in this revision

Viewing changes to vfw/build/cygwin/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-02-14 12:51:13 UTC
  • Revision ID: james.westby@ubuntu.com-20060214125113-t2vdkiqgcctz9ndd
Tags: upstream-0.cvs20060210
ImportĀ upstreamĀ versionĀ 0.cvs20060210

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Makefile for x264 VFW driver
 
4
#
 
5
# Author: XviD project:
 
6
#            - Milan Cutka <cutka at szm.sk>,
 
7
#            - Edouard Gomez <ed.gomez at free.fr>
 
8
#            - Peter Ross <pross@xvid.org>
 
9
# Ported to x264 by Laurent Aimar <fenrir@via.ecp.fr>
 
10
#
 
11
# $Id: Makefile,v 1.1 2004/06/03 19:29:33 fenrir Exp $
 
12
##############################################################################
 
13
 
 
14
include config.mak
 
15
 
 
16
# Dll to build
 
17
DLL=x264vfw.dll
 
18
 
 
19
# Installer executable
 
20
INST_EXE=x264vfw.exe
 
21
 
 
22
# Current dir
 
23
DIR_CUR=$(shell pwd)
 
24
 
 
25
# Path to include filen library and src
 
26
DIR_INC=$(DIR_CUR)/../../..
 
27
DIR_LIB=$(DIR_CUR)/../../..
 
28
DIR_SRC=$(DIR_CUR)/../..
 
29
 
 
30
# Sources
 
31
SRC_C= codec.c config.c driverproc.c
 
32
SRC_RES= resource.rc
 
33
 
 
34
# Alias
 
35
RM= rm -rf
 
36
WINDRES=windres
 
37
 
 
38
##############################################################################
 
39
# CFLAGS
 
40
##############################################################################
 
41
 
 
42
# Constants which should not be modified
 
43
# The `mingw-runtime` package is required when building with -mno-cygwin
 
44
CFLAGS += -I$(DIR_SRC)/w32api -I$(DIR_INC)
 
45
CFLAGS += -D_WIN32_IE=0x0500
 
46
CFLAGS += -mno-cygwin
 
47
 
 
48
# Optional Compiler options
 
49
CFLAGS += -Wall
 
50
CFLAGS += -O3
 
51
 
 
52
##############################################################################
 
53
# Compiler flags for linking stage
 
54
##############################################################################
 
55
 
 
56
LDFLAGS += -L$(DIR_LIB) -lx264
 
57
 
 
58
##############################################################################
 
59
# Rules
 
60
##############################################################################
 
61
 
 
62
OBJECTS = $(SRC_C:.c=.obj)
 
63
OBJECTS+= $(SRC_RES:.rc=.obj)
 
64
 
 
65
.SUFFIXES: .obj .rc .c
 
66
 
 
67
DIR_BUILD= $(DIR_CUR)/bin
 
68
VPATH = $(DIR_SRC):$(DIR_BUILD)
 
69
 
 
70
all: $(DLL)
 
71
 
 
72
$(DIR_BUILD):
 
73
        @echo " D: $(DIR_BUILD)"
 
74
        @mkdir -p $(DIR_BUILD)
 
75
 
 
76
.rc.obj:
 
77
        @echo " W: $(@D)/$(<F)"
 
78
        @mkdir -p $(DIR_BUILD)/$(@D)
 
79
        @$(WINDRES) \
 
80
        --include-dir=$(DIR_SRC) \
 
81
        --input-format=rc \
 
82
        --output-format=coff \
 
83
        -o $(DIR_BUILD)/$@ $<
 
84
 
 
85
.c.obj:
 
86
        @echo " C: $(@D)/$(<F)"
 
87
        @mkdir -p $(DIR_BUILD)/$(@D)
 
88
        @$(CC) $(CFLAGS) -c -o $(DIR_BUILD)/$@ $<
 
89
 
 
90
$(DLL): $(DIR_BUILD) $(OBJECTS)
 
91
        @echo " L: $(@F)"
 
92
        @cp $(DIR_SRC)/driverproc.def $(DIR_BUILD)/driverproc.def
 
93
        @cd $(DIR_BUILD) && \
 
94
        $(CC) \
 
95
        -mno-cygwin -shared -Wl,-dll,--out-implib,$@.a,--enable-stdcall-fixup \
 
96
        -o $@ \
 
97
        $(OBJECTS) driverproc.def \
 
98
        -lgdi32 -lwinmm -lcomdlg32 -lcomctl32 $(LDFLAGS)
 
99
 
 
100
clean:
 
101
        @echo " Cl: Object files and target lib"
 
102
        @$(RM) $(DIR_BUILD)
 
103
 
 
104
install:
 
105
        @echo " I: x264vfw.dll"
 
106
        @cp $(DIR_BUILD)/$(DLL) $(DLL)
 
107
        @cp $(DIR_SRC)/build/win32/bin/x264vfw.inf .
 
108
        @rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 $(DIR_CUR)/x264vfw.inf
 
109
        @rm $(DLL)
 
110
        @rm x264vfw.inf
 
111
 
 
112
uninstall:
 
113
        @echo " U: x264vfw.dll"
 
114
        @cp $(DIR_SRC)/build/win32/bin/x264vfw.inf .
 
115
        @rundll32.exe setupapi,InstallHinfSection Remove_x264 132 $(DIR_CUR)/x264vfw.inf
 
116
        @rm x264vfw.inf
 
117
 
 
118
##############################################################################
 
119
# Builds the NSIS installer script for Windows.
 
120
# NSIS 2.x is required and makensis.exe should be in the path
 
121
##############################################################################
 
122
 
 
123
build-installer: $(DLL)
 
124
        @cp $(DIR_BUILD)/$(DLL) $(DIR_SRC)/installer
 
125
        @makensis $(DIR_SRC)/installer/x264-conf.nsi
 
126
        @mv $(DIR_SRC)/installer/$(INST_EXE) $(DIR_BUILD)
 
127
        @rm $(DIR_SRC)/installer/$(DLL)