Update to another gettext public build
[platform/upstream/gstreamer.git] / win32 / vs7 / Makefile
1 # Project: libgstreamer
2 # Makefile to use with GNU Make
3 #
4 # Uses the Free Visual C++ 2003 compiler from Microsoft
5 # http://msdn.microsoft.com/visualc/vctoolkit2003/
6
7 # Compile with debug information ? IMPOSSIBLE with the free version of the compiler
8 DEBUG = no
9
10 # Link with MSVCRT as a DLL ? IMPOSSIBLE with the free version of the compiler
11 MSVCRT = yes
12
13 SRC_DIR=..\gst
14 GLIB_DIR=..\..\glib
15
16 #
17 # Don't change anything below this line.
18 #
19 CXX  = cl /Tp
20 CC   = cl /Tc
21 SRC  = dirent.c $(SRC_DIR)\parse\grammar.tab.c $(SRC_DIR)\gst.c $(SRC_DIR)\gstatomic.c $(SRC_DIR)\gstbin.c $(SRC_DIR)\gstbuffer.c \
22 $(SRC_DIR)\gstcaps.c $(SRC_DIR)\gstclock.c $(SRC_DIR)\gstcpu.c $(SRC_DIR)\gstdata.c $(SRC_DIR)\gstelement.c $(SRC_DIR)\gstelementfactory.c \
23 $(SRC_DIR)\gstenumtypes.c $(SRC_DIR)\gsterror.c $(SRC_DIR)\gstevent.c $(SRC_DIR)\gstfilter.c $(SRC_DIR)\gstformat.c $(SRC_DIR)\gstindex.c \
24 $(SRC_DIR)\gstinfo.c $(SRC_DIR)\gstmarshal.c $(SRC_DIR)\gstmemchunk.c $(SRC_DIR)\gstobject.c $(SRC_DIR)\gstpad.c $(SRC_DIR)\gstparse.c \
25 $(SRC_DIR)\gstpipeline.c $(SRC_DIR)\gstplugin.c $(SRC_DIR)\gstpluginfeature.c $(SRC_DIR)\gstprobe.c $(SRC_DIR)\gstquery.c $(SRC_DIR)\gstqueue.c \
26 $(SRC_DIR)\gstregistry.c $(SRC_DIR)\gstregistrypool.c $(SRC_DIR)\gstscheduler.c $(SRC_DIR)\gststructure.c $(SRC_DIR)\gstsystemclock.c \
27 $(SRC_DIR)\gsttag.c $(SRC_DIR)\gstthread.c $(SRC_DIR)\gsttrace.c $(SRC_DIR)\gsttypefind.c $(SRC_DIR)\gsturi.c $(SRC_DIR)\gsturitype.c \
28 $(SRC_DIR)\gstutils.c $(SRC_DIR)\gstvalue.c $(SRC_DIR)\gstxml.c $(SRC_DIR)\registries\gstxmlregistry.c $(SRC_DIR)\parse\lex._gst_parse_yy.c \
29 $(SRC_DIR)\..\libs\gst\control\control.c $(SRC_DIR)\..\libs\gst\control\unitconvert.c $(SRC_DIR)\..\libs\gst\control\dparammanager.c \
30 $(SRC_DIR)\..\libs\gst\control\dparam.c
31 OBJ  = $(patsubst %.c,%.obj,$(SRC))
32 INCS = /I. /I.. /I../libs /I../../popt/include /I../../libiconv/include /I../../libxml2/include/libxml2 /I$(GLIB_DIR) /I$(GLIB_DIR)\glib /I$(GLIB_DIR)\gmodule /I$(GLIB_DIR)\build\win32
33 LDFLAGS = /NOLOGO /DLL /IMPLIB:gstreamer-0.8.lib /MAP:gstreamer.map /LIBPATH:$(GLIB_DIR)/glib /LIBPATH:$(GLIB_DIR)/gobject /LIBPATH:$(GLIB_DIR)/gmodule /LIBPATH:$(GLIB_DIR)/gthread /LIBPATH:../../popt/lib /LIBPATH:../../libxml2/lib
34 OPTMIZ = /G6 /O2 /Oi /Wp64 /GL
35 CXXFLAGS = $(INCS) /DWIN32 /D_WINDOWS /DHAVE_CONFIG_H /D_USRDLL /DHAVE_WIN32 /DGST_EXPORTS /nologo
36
37
38 HEADERS = $(SRC_DIR)\gstversion.h $(SRC_DIR)\gstconfig.h $(SRC_DIR)\gstenumtypes.h $(SRC_DIR)\gstenumtypes.c $(SRC_DIR)\gstmarshal.h
39
40 ifeq (yes,$(DEBUG))
41
42 ifeq (yes,$(MSVCRT))
43  CXXFLAGS += /MDd
44 else
45  CXXFLAGS += /MTd
46 endif
47 CXXFLAGS += /Zi /DDEBUG /D_DEBUG /RTC1
48 LDFLAGS += /DEBUG
49
50 else
51
52 ifeq (yes,$(MSVCRT))
53  CXXFLAGS += /MD
54 else
55  CXXFLAGS += /MT
56 endif
57 CXXFLAGS += /DGST_DISABLE_GST_DEBUG
58 LDFLAGS += /OPT:REF
59 endif
60
61 LIBS = libgstreamer-0.8.dll
62
63 .PHONY: all all-before all-after clean clean-custom
64
65 %.obj : %.cpp
66         $(CXX) $< /c $(CXXFLAGS) /Fo$@
67
68 %.obj : %.c
69         $(CC) $< /c $(CXXFLAGS) /Fo$@
70
71 all: lib
72         make -f Makefile.inspect
73         make -f Makefile.launch
74         make -f Makefile.register
75
76 lib: $(LIBS)
77
78 clean:
79         make -f Makefile.inspect  clean
80         make -f Makefile.launch   clean
81         make -f Makefile.register clean
82         $(RM) $(OBJ) $(HEADERS) gstreamer-0.8.lib libgstreamer-0.8.dll gstreamer.map gstreamer-0.8.exp lex._gst_parse_yy.c gst.def
83
84 libgstreamer-0.8.dll: gst.def $(HEADERS) $(OBJ)
85         link $(LDFLAGS) /OUT:$@ $(OBJ) /DEF:gst.def glib-2.0.lib gobject-2.0.lib gthread-2.0.lib gmodule-2.0.lib libxml2.lib libpopt.lib wsock32.lib
86
87
88 ifeq (yes,$(DEBUG))
89 gst.def:
90         type gstreamer.def > gst.def
91         type gstreamer-dbg.def >> gst.def
92 else
93 gst.def:
94         type gstreamer.def > gst.def
95 endif
96
97 $(SRC_DIR)\gstversion.h: gstversion.h
98         copy $< $@
99
100 $(SRC_DIR)\gstconfig.h: gstconfig.h
101         copy $< $@
102
103 $(SRC_DIR)\gstenumtypes.c: gstenumtypes.c
104         copy $< $@
105
106 $(SRC_DIR)\gstenumtypes.h: gstenumtypes.h
107         copy $< $@
108
109
110 $(SRC_DIR)\gstmarshal.h:
111         echo #include "gst/gstconfig.h"              > $(SRC_DIR)\gstmarshal.h
112         $(GLIB_DIR)\gobject\glib-genmarshal --header --prefix=gst_marshal $(SRC_DIR)/gstmarshal.list >> $(SRC_DIR)/gstmarshal.h
113 $(SRC_DIR)\gstmarshal.c:
114         echo #include "glib-object.h" > $(SRC_DIR)\gstmarshal.c
115         echo #include "gstmarshal.h" >> $(SRC_DIR)\gstmarshal.c
116         $(GLIB_DIR)\gobject\glib-genmarshal --body --prefix=gst_marshal $(SRC_DIR)/gstmarshal.list >> $(SRC_DIR)/gstmarshal.c
117
118 # generated sources, otherwise you should get these files from somewhere else
119 $(SRC_DIR)\parse\grammar.tab.c:
120         bison -d -v -p_gst_parse__yy $(SRC_DIR)\parse\grammar.y -o $(SRC_DIR)\parse\grammar.tab.c
121
122 $(SRC_DIR)\parse\lex._gst_parse_yy.c:
123         flex -P_gst_parse_yy $(SRC_DIR)\parse\parse.l
124         copy lex._gst_parse_yy.c $(SRC_DIR)\parse\lex._gst_parse_yy.c
125
126 depend:
127         $(CXX) $(CXXFLAGS) -MM $(SRC) > .depend
128
129 #
130 # include dependency files if they exist
131 #
132 ifneq ($(wildcard .depend),)
133 include .depend
134 endif