• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17{..\src\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\}.obj::
18	$(CC) $(BASE_CFLAGS) $(PSL_ADDITIONAL_CFLAGS) $(PSL_INCLUDES) /Fovs$(VSVER)\$(CFG)\$(PLAT)\libpsl\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\libpsl\ /c @<<
19$<
20<<
21
22{..\tools\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\psl\}.obj::
23	$(CC) $(BASE_CFLAGS) $(PSL_INCLUDES) /Fovs$(VSVER)\$(CFG)\$(PLAT)\psl\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\psl\ /c @<<
24$<
25<<
26
27# Make sure we generate suffixes_dafsa.h before trying to compile psl.c
28vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\psl.obj: vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\suffixes_dafsa.h
29
30# Inference rules for building the test programs
31# Used for programs with a single source file.
32# Format is as follows
33# (all dirs must have a trailing '\'):
34#
35# {$(srcdir)}.$(srcext){$(destdir)}.exe::
36# 	$(CC)|$(CXX) $(cflags) $< /Fo$*.obj  /Fe$@ [/link $(linker_flags) $(dep_libs)]
37
38{..\tests\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\}.exe:
39	@if not exist $(PSL_UTILS) $(MAKE) -f Makefile.vc $(PSL_MAKE_OPTIONS) $(PSL_UTILS)
40	@if not exist vs$(VSVER)\$(CFG)\$(PLAT)\tests $(MAKE) -f Makefile.vc $(PSL_MAKE_OPTIONS) vs$(VSVER)\$(CFG)\$(PLAT)\tests
41	$(CC) $(PSL_TEST_CFLAGS) $(PSL_INCLUDES)	\
42	/Fovs$(VSVER)\$(CFG)\$(PLAT)\tests\	\
43	/Fdvs$(VSVER)\$(CFG)\$(PLAT)\tests\ /Fe$@	\
44	$< /link $(LDFLAGS) $(PSL_LIB) $(PSL_ADDITIONAL_LIBS)
45	@if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
46
47# Rules for building .lib files
48!ifdef STATIC
49$(PSL_LIB): vs$(VSVER)\$(CFG)\$(PLAT)\libpsl ..\config.h $(libpsl_OBJS)
50	lib $(ARFLAGS) /out:$@ @<<
51$(libpsl_OBJS)
52<<
53
54!else
55$(PSL_LIB): $(PSL_DLL)
56!endif
57
58# Rules for linking DLLs
59# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
60# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
61#	link /DLL [$(linker_flags)] [$(dependent_libs)] [/def:$(def_file_if_used)] [/implib:$(lib_name_if_needed)] -out:$@ @<<
62# $(dependent_objects)
63# <<
64# 	@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
65
66$(PSL_DLL): ..\config.h $(libpsl_OBJS)
67	link $(LDFLAGS) $(PSL_ADDITIONAL_LIBS) /DLL /out:$@ @<<
68$(libpsl_OBJS)
69<<
70	@if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
71
72# Rules for linking Executables
73# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
74# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
75#	link [$(linker_flags)] [$(dependent_libs)] -out:$@ @<<
76# $(dependent_objects)
77# <<
78# 	@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
79
80vs$(VSVER)\$(CFG)\$(PLAT)\psl.exe: $(PSL_LIB) vs$(VSVER)\$(CFG)\$(PLAT)\psl $(psl_OBJS)
81	link $(LDFLAGS) $(PSL_LIB) $(PSL_ADDITIONAL_LIBS) /PDB:$(@R)-tool.pdb /out:$@ @<<
82$(psl_OBJS)
83<<
84	@if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
85
86# Show the build configuration for this build
87build-info:
88	@echo -------------------------------
89	@echo Build configuration for libpsl:
90	@echo -------------------------------
91	@echo Configuration/Platform: $(CFG)/$(PLAT)
92	@echo Library Build Type: $(PSL_LIBTYPE)
93	@echo Enabled Runtime: $(ENABLED_RUNTIME)
94	@echo Enabled Builtin: $(ENABLED_BUILTIN)
95	@if not "$(ENABLED_BUILTIN)" == "none" echo PSL File: $(PSL_FILE)
96
97clean:
98	@if exist vs$(VSVER)\$(CFG)\$(PLAT)\psl.dafsa del vs$(VSVER)\$(CFG)\$(PLAT)\psl.dafsa
99	@if exist vs$(VSVER)\$(CFG)\$(PLAT)\psl_ascii.dafsa del vs$(VSVER)\$(CFG)\$(PLAT)\psl_ascii.dafsa
100	@if exist .\libpsl.pc del /f /q .\libpsl.pc
101	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
102	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib
103	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb
104	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll.manifest
105	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
106	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk
107	@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\tests\*.pdb
108	@-if exist vs$(VSVER)\$(CFG)\$(PLAT)\tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\tests\*.obj
109	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\psl\*.pdb
110	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\psl\*.obj
111	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\*.pdb
112	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\*.obj
113	@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\libpsl\suffixes_dafsa.h
114	@-del /f /q ..\config.h
115	@-rmdir /s /q vs$(VSVER)\$(CFG)\$(PLAT)
116