Skip to content

Commit 79b74f8

Browse files
committed
NMake Makefiles: Streamline builds from GIT checkouts
Streamline the source generating process into the 'all' target, so there is no more need to run the 'prep-git-build' target.
1 parent 099ab4c commit 79b74f8

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

MSVC_NMake/Makefile.vc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ VALID_MSC = TRUE
3232

3333
!ifdef GENERATE_VERSIONED_FILES
3434
!include pkg-ver.mak
35+
DO_REAL_GEN=1
3536
!endif
3637

3738
all: $(LIBSIGC_LIB) examples all-build-info

MSVC_NMake/README.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ targets:
2121
Building directly from a GIT checkout is now supported, provided that a PERL
2222
installation is present (pass the PERL interpreter executable in your NMake
2323
command line by using 'PERL=<path_to_PERL_interpreter_executable>' by using
24-
the 'prep-git-build' target. Note that in this case, the 'prep-git-build'
25-
target needs to be run before building any of the other targets.
24+
the 'prep-git-build' target.
2625

2726
The following are instructions for performing such a build. A 'clean' target is
2827
provided-it is recommended that one cleans the build and redo the build if any

MSVC_NMake/build-rules-msvc.mak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
# $<
1515
# <<
1616
{..\sigc++\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj:
17+
@if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h
1718
@if not exist $(@D)\ md $(@D)
1819
$(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<<
1920
$<
2021
<<
2122

2223
{..\sigc++\functors\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj:
24+
@if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h
2325
@if not exist $(@D)\ md $(@D)
2426
$(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<<
2527
$<

MSVC_NMake/generate-msvc.mak

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,29 @@
77

88
prep-git-build: pkg-ver.mak
99

10-
sigc.rc: pkg-ver.mak sigc.rc.in
11-
@echo Generating $@...
12-
@copy $@.in $@
13-
@$(PERL) -pi.bak -e "s/\@SIGCXX_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
14-
@$(PERL) -pi.bak -e "s/\@SIGCXX_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
15-
@$(PERL) -pi.bak -e "s/\@SIGCXX_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
16-
@$(PERL) -pi.bak -e "s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
17-
@$(PERL) -pi.bak -e "s/\@SIGCXX_API_VERSION\@/$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)/g" $@
18-
@del $@.bak
10+
sigc.rc: ..\configure.ac sigc.rc.in
11+
@if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
12+
@if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
13+
@if "$(DO_REAL_GEN)" == "1" echo Generating $@...
14+
@if "$(DO_REAL_GEN)" == "1" copy $@.in $@
15+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@SIGCXX_MAJOR_VERSION\@/$(PKG_MAJOR_VERSION)/g" $@
16+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@SIGCXX_MINOR_VERSION\@/$(PKG_MINOR_VERSION)/g" $@
17+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@SIGCXX_MICRO_VERSION\@/$(PKG_MICRO_VERSION)/g" $@
18+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@PACKAGE_VERSION\@/$(PKG_MAJOR_VERSION).$(PKG_MINOR_VERSION).$(PKG_MICRO_VERSION)/g" $@
19+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\@SIGCXX_API_VERSION\@/$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)/g" $@
20+
@if "$(DO_REAL_GEN)" == "1" del $@.bak
1921

2022
# You may change SIGCXX_DISABLE_DEPRECATED if you know what you are doing
21-
sigc++config.h: pkg-ver.mak ..\sigc++config.h.in
22-
@echo Generating $@...
23-
@copy "..\$(@F).in" "$@"
24-
@$(PERL) -pi.bak -e "s/\#undef SIGCXX_DISABLE_DEPRECATED/\/\* \#undef SIGCXX_DISABLE_DEPRECATED \*\//g" $@
25-
@$(PERL) -pi.bak -e "s/\#undef SIGCXX_MAJOR_VERSION/\#define SIGCXX_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
26-
@$(PERL) -pi.bak -e "s/\#undef SIGCXX_MINOR_VERSION/\#define SIGCXX_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
27-
@$(PERL) -pi.bak -e "s/\#undef SIGCXX_MICRO_VERSION/\#define SIGCXX_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
28-
@del $@.bak
23+
sigc++config.h: ..\configure.ac ..\sigc++config.h.in
24+
@if not "$(DO_REAL_GEN)" == "1" if exist pkg-ver.mak del pkg-ver.mak
25+
@if not exist pkg-ver.mak $(MAKE) /f Makefile.vc CFG=$(CFG) prep-git-build
26+
@if "$(DO_REAL_GEN)" == "1" echo Generating $@...
27+
@if "$(DO_REAL_GEN)" == "1" copy "..\$(@F).in" "$@"
28+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef SIGCXX_DISABLE_DEPRECATED/\/\* \#undef SIGCXX_DISABLE_DEPRECATED \*\//g" $@
29+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef SIGCXX_MAJOR_VERSION/\#define SIGCXX_MAJOR_VERSION $(PKG_MAJOR_VERSION)/g" $@
30+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef SIGCXX_MINOR_VERSION/\#define SIGCXX_MINOR_VERSION $(PKG_MINOR_VERSION)/g" $@
31+
@if "$(DO_REAL_GEN)" == "1" $(PERL) -pi.bak -e "s/\#undef SIGCXX_MICRO_VERSION/\#define SIGCXX_MICRO_VERSION $(PKG_MICRO_VERSION)/g" $@
32+
@if "$(DO_REAL_GEN)" == "1" del $@.bak
2933

3034
pkg-ver.mak: ..\configure.ac
3135
@echo Generating version info Makefile Snippet...

0 commit comments

Comments
 (0)