Imported Upstream version 1.2.7
[platform/upstream/harfbuzz.git] / win32 / build-rules-msvc.mak
1 # NMake Makefile portion for compilation rules
2 # Items in here should not need to be edited unless
3 # one is maintaining the NMake build files.  The format
4 # of NMake Makefiles here are different from the GNU
5 # Makefiles.  Please see the comments about these formats.
6
7 # Inference rules for compiling the .obj files.
8 # Used for libs and programs with more than a single source file.
9 # Format is as follows
10 # (all dirs must have a trailing '\'):
11 #
12 # {$(srcdir)}.$(srcext){$(destdir)}.obj::
13 #       $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
14 # $<
15 # <<
16 {..\src\}.cc{$(CFG)\$(PLAT)\harfbuzz\}.obj::
17         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_LIB_CFLAGS) /Fo$(CFG)\$(PLAT)\harfbuzz\ /c @<<
18 $<
19 <<
20
21 {..\src\hb-ucdn\}.c{$(CFG)\$(PLAT)\harfbuzz\}.obj::
22         $(CC) $(CFLAGS) /Fo$(CFG)\$(PLAT)\harfbuzz\ /c @<<
23 $<
24 <<
25
26 {..\src\}.cc{$(CFG)\$(PLAT)\harfbuzz-icu\}.obj::
27         $(CXX) $(CFLAGS) $(HB_LIB_CFLAGS) $(HB_ICU_CFLAGS) /Fo$(CFG)\$(PLAT)\harfbuzz-icu\ /c @<<
28 $<
29 <<
30
31 {..\util\}.cc{$(CFG)\$(PLAT)\util\}.obj::
32         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) /Fo$(CFG)\$(PLAT)\util\ /c @<<
33 $<
34 <<
35
36 # Inference rules for building the test programs
37 # Used for programs with a single source file.
38 # Format is as follows
39 # (all dirs must have a trailing '\'):
40 #
41 # {$(srcdir)}.$(srcext){$(destdir)}.exe::
42 #       $(CC)|$(CXX) $(cflags) $< /Fo$*.obj  /Fe$@ [/link $(linker_flags) $(dep_libs)]
43 {..\src\}.cc{$(CFG)\$(PLAT)\}.exe:
44         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) $< /Fo$*.obj  /Fe$@ /link $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_TESTS_DEP_LIBS)
45
46 {..\test\api\}.c{$(CFG)\$(PLAT)\}.exe:
47         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) /DSRCDIR="\"../../../test/api\"" $< /Fo$*.obj /Fe$@ /link $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_TESTS_DEP_LIBS)
48
49 # Rules for building .lib files
50 $(CFG)\$(PLAT)\harfbuzz.lib: $(HARFBUZZ_DLL_FILENAME).dll
51 $(CFG)\$(PLAT)\harfbuzz-icu.lib: $(HARFBUZZ_ICU_DLL_FILENAME).dll
52 $(CFG)\$(PLAT)\harfbuzz-gobject.lib: $(HARFBUZZ_GOBJECT_DLL_FILENAME).dll
53
54 # Rules for linking DLLs
55 # Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
56 # $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
57 #       link /DLL [$(linker_flags)] [$(dependent_libs)] [/def:$(def_file_if_used)] [/implib:$(lib_name_if_needed)] -out:$@ @<<
58 # $(dependent_objects)
59 # <<
60 #       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
61 $(HARFBUZZ_DLL_FILENAME).dll: config.h $(harfbuzz_dll_OBJS) $(CFG)\$(PLAT)\harfbuzz
62         link /DLL $(LDFLAGS) $(HB_DEP_LIBS) /implib:$(CFG)\$(PLAT)\harfbuzz.lib -out:$@ @<<
63 $(harfbuzz_dll_OBJS)
64 <<
65         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
66
67 $(HARFBUZZ_ICU_DLL_FILENAME).dll: $(CFG)\$(PLAT)\harfbuzz.lib $(harfbuzz_icu_OBJS) $(CFG)\$(PLAT)\harfbuzz-icu
68         link /DLL $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_ICU_DEP_LIBS) /implib:$(CFG)\$(PLAT)\harfbuzz-icu.lib -out:$@ @<<
69 $(harfbuzz_icu_OBJS)
70 <<
71         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
72
73 $(HARFBUZZ_GOBJECT_DLL_FILENAME).dll: $(CFG)\$(PLAT)\harfbuzz.lib $(harfbuzz_gobject_OBJS) $(CFG)\$(PLAT)\harfbuzz-gobject
74         link /DLL $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_GOBJECT_DEP_LIBS) /implib:$(CFG)\$(PLAT)\harfbuzz-gobject.lib -out:$@ @<<
75 $(harfbuzz_gobject_OBJS)
76 <<
77         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
78
79 # Rules for linking Executables
80 # Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
81 # $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
82 #       link [$(linker_flags)] [$(dependent_libs)] -out:$@ @<<
83 # $(dependent_objects)
84 # <<
85 #       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
86 $(CFG)\$(PLAT)\hb-view.exe: $(CFG)\$(PLAT)\harfbuzz.lib $(CFG)\$(PLAT)\util $(hb_view_OBJS)
87         link $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_UTILS_DEP_LIBS) -out:$@ @<<
88 $(hb_view_OBJS)
89 <<
90         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
91
92 $(CFG)\$(PLAT)\hb-shape.exe: $(CFG)\$(PLAT)\harfbuzz.lib $(CFG)\$(PLAT)\util $(hb_shape_OBJS)
93         link $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_UTILS_DEP_LIBS) -out:$@ @<<
94 $(hb_shape_OBJS)
95 <<
96         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
97
98 $(CFG)\$(PLAT)\hb-ot-shape-closure.exe: $(CFG)\$(PLAT)\harfbuzz.lib $(CFG)\$(PLAT)\util $(hb_ot_shape_closure_OBJS)
99         link $(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_UTILS_DEP_LIBS) -out:$@ @<<
100 $(hb_ot_shape_closure_OBJS)
101 <<
102         @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
103
104 # Other .obj files requiring individual attention, that could not be covered by the inference rules.
105 # Format is as follows (all dirs must have a trailing '\'):
106 #
107 # $(obj_file):
108 #       $(CC)|$(CXX) $(cflags) /Fo$(obj_destdir) /c @<<
109 # $(srcfile)
110 # <<
111 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-structs.obj: $(CFG)\$(PLAT)\harfbuzz-gobject $(HB_GOBJECT_ENUM_GENERATED_SOURCES)
112         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_LIB_CFLAGS) /I$(CFG)\$(PLAT)\harfbuzz-gobject /Fo$(CFG)\$(PLAT)\harfbuzz-gobject\ /c @<<
113 ..\src\hb-gobject-structs.cc
114 <<
115
116 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.obj: $(CFG)\$(PLAT)\harfbuzz-gobject $(HB_GOBJECT_ENUM_GENERATED_SOURCES)
117         $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_LIB_CFLAGS) /I$(CFG)\$(PLAT)\harfbuzz-gobject /Fo$(CFG)\$(PLAT)\harfbuzz-gobject\ /c @<<
118 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc
119 <<
120
121 clean:
122         @-if exist $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib del /f /q $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
123         @-if exist $(CFG)\$(PLAT)\HarfBuzz-0.0.gir del /f /q $(CFG)\$(PLAT)\HarfBuzz-0.0.gir
124         @-if exist $(CFG)\$(PLAT)\hb_list del /f /q $(CFG)\$(PLAT)\hb_list
125         @-del /f /q $(CFG)\$(PLAT)\*.pdb
126         @-if exist $(CFG)\$(PLAT)\.exe.manifest del /f /q $(CFG)\$(PLAT)\*.exe.manifest
127         @-if exist $(CFG)\$(PLAT)\.exe del /f /q $(CFG)\$(PLAT)\*.exe
128         @-del /f /q $(CFG)\$(PLAT)\*.dll.manifest
129         @-del /f /q $(CFG)\$(PLAT)\*.dll
130         @-del /f /q $(CFG)\$(PLAT)\*.ilk
131         @-del /f /q $(CFG)\$(PLAT)\*.obj
132         @-if exist $(CFG)\$(PLAT)\util del /f /q $(CFG)\$(PLAT)\util\*.obj
133         @-if exist $(CFG)\$(PLAT)\harfbuzz-gobject del /f /q $(CFG)\$(PLAT)\harfbuzz-gobject\*.obj
134         @-if exist $(CFG)\$(PLAT)\harfbuzz-icu del /f /q $(CFG)\$(PLAT)\harfbuzz-icu\*.obj
135         @-del /f /q $(CFG)\$(PLAT)\harfbuzz\*.obj
136         @-rmdir /s /q $(CFG)\$(PLAT)
137         @-if exist $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h del $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h
138         @-if exist $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc del $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc
139         @-del vc$(VSVER)0.pdb
140         @-del config.h