[svn] / trunk / xvidcore / dshow / Makefile Repository:
ViewVC logotype

View of /trunk/xvidcore/dshow/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1503 - (download) (annotate)
Sun Jul 18 02:00:05 2004 UTC (15 years, 4 months ago) by suxen_drol
File size: 3389 byte(s)
gcc build environment
##############################################################################
#
# Makefile for XviD DirectShow driver
#
# Adapted from XviD VFW driver makefile.
# Modified by : Peter Ross <pross@xvid.org>
#
# Requires GNU Make because of shell expansion performed at a bad time with
# other make programs (even using := variable assignments)
#
# $Id: Makefile,v 1.1 2004-07-18 02:00:05 suxen_drol Exp $
##############################################################################

include sources.inc

##############################################################################
# DXTREE must point to the DirectShow SDK root directory.
##############################################################################
DXTREE=/c/DXVCSDK

MAKEFILE_PWD:=$(shell pwd)
LOCAL_XVID_SRCTREE:=$(MAKEFILE_PWD)/../src
LOCAL_XVID_BUILDTREE:=$(MAKEFILE_PWD)/../build/generic/=build

RM = rm -rf
WINDRES=windres

# Constants which should not be modified
# The `mingw-runtime` package is required when building with -mno-cygwin
CFLAGS += -mthreads
CFLAGS += -I$(SRC_DIR)/w32api -I$(LOCAL_XVID_SRCTREE)
CFLAGS += -D_WIN32_IE=0x0500
CFLAGS += -mno-cygwin

## for some unknown reason, xvid.ax crashes if -g is not specified.
## maybe a gcc-3.2.3 issue
CXXFLAGS +=-g -mthreads
CXXFLAGS += -DRELEASE \
        -I$(LOCAL_XVID_SRCTREE) \
        -I$(DXTREE)/Include \
        -I$(DXTREE)/samples/MultiMedia/DirectShow/BaseClasses \
        -include $(DXTREE)/mingw_dshow_port.h
CXXFLAGS += -mno-cygwin

##############################################################################
# Optional Compiler options
##############################################################################

CFLAGS += -Wall
CFLAGS += -O2
CFLAGS += -fstrength-reduce
CFLAGS += -finline-functions
CFLAGS += -fgcse
CFLAGS += -freduce-all-givs
CFLAGS += -ffast-math

CXXFLAGS += -O2

##############################################################################
# Compiler flags for linking stage
##############################################################################

#LDFLAGS +=

##############################################################################
# Rules
##############################################################################

OBJECTS = $(SRC_C:.c=.obj)
OBJECTS+= $(SRC_CPP:.cpp=.obj)
OBJECTS+= $(SRC_RES:.rc=.obj)

.SUFFIXES: .obj .rc .c

BUILD_DIR = =build
VPATH     = $(SRC_DIR):$(BUILD_DIR)

all: $(LIBSO)

$(BUILD_DIR):
	@echo "  D: $(BUILD_DIR)"
	@mkdir -p $(BUILD_DIR)

.rc.obj:
	@echo "  W: $(@D)/$(<F)"
	@mkdir -p $(BUILD_DIR)/$(@D)
	@$(WINDRES) \
		--include-dir=$(SRC_DIR) \
		--input-format=rc \
		--output-format=coff \
		-o $(BUILD_DIR)/$@ $<

.c.obj:
	@echo "  C: $(@D)/$(<F)"
	@mkdir -p $(BUILD_DIR)/$(@D)
	@$(CC) $(CFLAGS) -c -o $(BUILD_DIR)/$@ $<

.cpp.obj:
	@echo "  C: $(@D)/$(<F)"
	@mkdir -p $(BUILD_DIR)/$(@D)
	@$(CXX) $(CXXFLAGS) -c -o $(BUILD_DIR)/$@ $<

$(LIBSO): $(BUILD_DIR) $(OBJECTS)
	@echo "  L: $(@F)"
	@cp $(SRC_DIR)/xvid.ax.def $(BUILD_DIR)/xvid.ax.def
	@cd $(BUILD_DIR) && \
		$(CC) $(LDFLAGS) \
			-mno-cygwin -shared -Wl,-dll,--out-implib,$@.a,--enable-stdcall-fixup \
			-o $@ \
			$(OBJECTS) xvid.ax.def \
			-L$(DXTREE)/Lib -lstrmiids \
			$(DXTREE)/samples/Multimedia/DirectShow/BaseClasses/strmbase.a \
			-luuid -lwinmm -lole32 -loleaut32 -lcomctl32 -lstdc++
			

clean:
	@echo "  Cl: Object files and target lib"
	@$(RM) $(BUILD_DIR)

install:

uninstall:

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4