Changeset: 6944967fbdfc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6944967fbdfc
Modified Files:
        NT/Makefile
        NT/rules.msc
        buildtools/autogen/autogen/msc.py
Branch: Mar2011
Log Message:

Use $(srcdir) in Windows Makefiles instead of $(SRCDIR).
This is to make it possible to use $(srcdir) in Makefile.ag.


diffs (truncated from 327 to 300 lines):

diff --git a/NT/Makefile b/NT/Makefile
--- a/NT/Makefile
+++ b/NT/Makefile
@@ -18,27 +18,27 @@
 # All Rights Reserved.
 
 TOPDIR = .
-SRCDIR = $(TOPDIR)\..
+srcdir = $(TOPDIR)\..
 
 prefix = $(MAKEDIR)
 
 !INCLUDE "$(TOPDIR)\..\NT\rules.msc"
 
-all: "$(SRCDIR)\Makefile.msc" monetdb_config.h unistd.h inttypes.h .monetdb
-       $(MAKE) /nologo /f "$(SRCDIR)\Makefile.msc" "prefix=$(prefix)" 
"bits=$(bits)" all
+all: "$(srcdir)\Makefile.msc" monetdb_config.h unistd.h inttypes.h .monetdb
+       $(MAKE) /nologo /f "$(srcdir)\Makefile.msc" "prefix=$(prefix)" 
"bits=$(bits)" all
 
 install: targetdirs all
-       $(MAKE) /nologo /f "$(SRCDIR)\Makefile.msc" "prefix=$(prefix)" 
"bits=$(bits)" install
+       $(MAKE) /nologo /f "$(srcdir)\Makefile.msc" "prefix=$(prefix)" 
"bits=$(bits)" install
        $(INSTALL) .monetdb "$(sysconfdir)"
        $(INSTALL) ..\NT\installer$(bits)\*.sln "$(prefix)"
        $(INSTALL) ..\NT\installer$(bits)\*.vdproj "$(prefix)"
        -if exist "C:\Program Files (x86)" if $(bits)==32 cd 
"$(prefix)"&&C:\cygwin\bin\sed.exe -i "s/Program Files/Program Files (x86)/" 
*.vdproj
 
-$(SRCDIR)\Makefile.msc: "$(SRCDIR)\Makefile.ag"
-        cd "$(SRCDIR)"&&set PYTHONPATH=buildtools\autogen&&python 
buildtools\autogen\autogen.py
+$(srcdir)\Makefile.msc: "$(srcdir)\Makefile.ag"
+        cd "$(srcdir)"&&set PYTHONPATH=buildtools\autogen&&python 
buildtools\autogen\autogen.py
 
-monetdb_config.h: "$(SRCDIR)\NT\monetdb_config.h.in"
-       $(CONFIGURE) "$(SRCDIR)\NT\monetdb_config.h.in" > monetdb_config.h
+monetdb_config.h: "$(srcdir)\NT\monetdb_config.h.in"
+       $(CONFIGURE) "$(srcdir)\NT\monetdb_config.h.in" > monetdb_config.h
 
 unistd.h:
        $(ECHO) #ifndef UNISTD_H > unistd.h
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -415,19 +415,19 @@
 
 CONFIG_H = monetdb_config.h
 
-{$(SRCDIR)}.mx.h:
+{$(srcdir)}.mx.h:
        $(MX) $(MXFLAGS) -l -x h $<
 
 .mx.h:
        $(MX) $(MXFLAGS) -l -x h $<
 
-{$(SRCDIR)}.mx.c:
+{$(srcdir)}.mx.c:
        $(MX) $(MXFLAGS) -x c $<
 
 .mx.c:
        $(MX) $(MXFLAGS) -x c $<
 
-{$(SRCDIR)}.mx.m:
+{$(srcdir)}.mx.m:
        $(MX) $(MXFLAGS) -l -x m $<
 
 .mx.m:
@@ -444,12 +444,12 @@
        if not exist .libs $(MKDIR) .libs
        $(INSTALL) $@ .libs\$@
 
-{$(SRCDIR)}.mx.tmpmil:
+{$(srcdir)}.mx.tmpmil:
        $(MX) $(MXFLAGS) -l -x mil $<
        $(MV) $*.mil $*.tmpmil
        $(DEL) $*.mil
 
-{$(SRCDIR)}.mx.mil:
+{$(srcdir)}.mx.mil:
        $(MX) $(MXFLAGS) -l -x mil $<
 
 .mx.tmpmil:
@@ -460,7 +460,7 @@
 .mx.mil:
        $(MX) $(MXFLAGS) -l -x mil $<
 
-{$(SRCDIR)}.mx.mal:
+{$(srcdir)}.mx.mal:
        $(MX) $(MXFLAGS) -l -x mal $<
        if not exist .libs $(MKDIR) .libs
        $(INSTALL) $@ .libs\$@
@@ -470,25 +470,25 @@
        if not exist .libs $(MKDIR) .libs
        $(INSTALL) $@ .libs\$@
 
-{$(SRCDIR)}.mx.sql:
+{$(srcdir)}.mx.sql:
        $(MX) $(MXFLAGS) -l -x sql $<
 
 .mx.sql:
        $(MX) $(MXFLAGS) -l -x sql $<
 
-{$(SRCDIR)}.mx.y:
+{$(srcdir)}.mx.y:
        $(MX) $(MXFLAGS) -x y $<
 
 .mx.y:
        $(MX) $(MXFLAGS) -x y $<
 
-{$(SRCDIR)}.mx.l:
+{$(srcdir)}.mx.l:
        $(MX) $(MXFLAGS) -x l $<
 
 .mx.l:
        $(MX) $(MXFLAGS) -x l $<
 
-{$(SRCDIR)}.ll.cc:
+{$(srcdir)}.ll.cc:
        $(LEX) $(LFLAGS) $<
        # either lex.<name>.c or lex.yy.c or lex.$(PARSERNAME).c gets generated
        if exist lex.$*.c $(MV) lex.$*.c $*.yy.c.tmp
@@ -506,7 +506,7 @@
        echo #include "$(CONFIG_H)" > $@
        type $*.yy.c.tmp >> $@
 
-{$(SRCDIR)}.yy.cc:
+{$(srcdir)}.yy.cc:
        $(YACC) $(YFLAGS) $<
        $(FILTER) $(FILTERPREF)"    ;" y.tab.c > $@
 
@@ -515,7 +515,7 @@
        $(FILTER) $(FILTERPREF)"    ;" y.tab.c > $@
        $(DEL) y.tab.h
 
-{$(SRCDIR)}.yy.h:
+{$(srcdir)}.yy.h:
        $(YACC) $(YFLAGS) $<
        $(DEL) y.tab.c
        $(MV) y.tab.h $@
@@ -525,19 +525,19 @@
        $(DEL) y.tab.c
        $(MV) y.tab.h $@
 
-{$(SRCDIR)}.c.obj:
+{$(srcdir)}.c.obj:
        $(CC) $(CFLAGS) -c $<
 
 .c.obj:
        $(CC) $(CFLAGS) -c $<
 
-{$(SRCDIR)}.cc.obj:
+{$(srcdir)}.cc.obj:
        $(CXX) $(CXXFLAGS) -c $<
 
 .cc.obj:
        $(CXX) $(CXXFLAGS) -c $<
 
-{$(SRCDIR)}.syms.def:
+{$(srcdir)}.syms.def:
        echo EXPORTS > $@
        type $< >> $@
 
@@ -545,7 +545,7 @@
        echo EXPORTS > $@
        type $< >> $@
 
-{$(SRCDIR)}.brg.c:
+{$(srcdir)}.brg.c:
        $(BURG) -c 1000 -d -I -p PF$* -o $@ < $<
 
 .brg.c:
diff --git a/buildtools/autogen/autogen/msc.py 
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -71,8 +71,8 @@
     fd.write('%s-%d-all: "%s-%d-dir" "%s-%d-Makefile"\n' % (n, i, n, i, n, i))
     fd.write('\t$(CD) "%s" && $(MAKE) /nologo $(MAKEDEBUG) "prefix=$(prefix)" 
"bits=$(bits)" all \n' % vv)
     fd.write('%s-%d-dir: \n\tif not exist "%s" $(MKDIR) "%s"\n' % (n, i, vv, 
vv))
-    fd.write('%s-%d-Makefile: "$(SRCDIR)\\%s\\Makefile.msc"\n' % (n, i, v))
-    fd.write('\t$(INSTALL) "$(SRCDIR)\\%s\\Makefile.msc" "%s\\Makefile"\n' % 
(v, v))
+    fd.write('%s-%d-Makefile: "$(srcdir)\\%s\\Makefile.msc"\n' % (n, i, v))
+    fd.write('\t$(INSTALL) "$(srcdir)\\%s\\Makefile.msc" "%s\\Makefile"\n' % 
(v, v))
     fd.write('%s-%d-check:\n' % (n, i))
     fd.write('\t$(CD) "%s" && $(MAKE) /nologo $(MAKEDEBUG) "prefix=$(prefix)" 
"bits=$(bits)" check\n' % vv)
 
@@ -155,7 +155,7 @@
     if dir[0] == '$':
         return ""
     elif not os.path.isabs(dir):
-        dir = "$(SRCDIR)/" + dir
+        dir = "$(srcdir)/" + dir
     else:
         return ""
     return prefix+string.replace(dir, '/', '\\')
@@ -172,7 +172,7 @@
     elif dir == "builddir":
         dir = "."
     elif dir == "srcdir":
-        dir = "$(SRCDIR)"
+        dir = "$(srcdir)"
     elif dir in ('bindir', 'builddir', 'datadir', 'includedir', 'infodir',
                  'libdir', 'libexecdir', 'localstatedir', 'mandir',
                  'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir',
@@ -186,7 +186,7 @@
 
 def msc_translate_file(path, msc):
     if os.path.isfile(os.path.join(msc['cwd'], path)):
-        return "$(SRCDIR)\\" + path
+        return "$(srcdir)\\" + path
     return path
 
 def msc_space_sep_list(l):
@@ -456,7 +456,7 @@
         if msc['INSTALL'].has_key(script):
             continue
         if os.path.isfile(os.path.join(msc['cwd'], script+'.in')):
-            inf = '$(SRCDIR)\\%s.in' % script
+            inf = '$(srcdir)\\%s.in' % script
             if inf not in msc['_IN']:
                 # TODO
                 # replace this hack by something like configure ...
@@ -464,8 +464,8 @@
                 fd.write('\t$(CONFIGURE) "%s" > "%s"\n' % (inf, script))
                 msc['_IN'].append(inf)
         elif os.path.isfile(os.path.join(msc['cwd'], script)):
-            fd.write('%s: "$(SRCDIR)\\%s"\n' % (script, script))
-            fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (script, script))
+            fd.write('%s: "$(srcdir)\\%s"\n' % (script, script))
+            fd.write('\t$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (script, script))
         if scripts.has_key('COND'):
             condname = 'defined(' + ') && defined('.join(scripts['COND']) + ')'
             mkname = script.replace('.', '_').replace('-', '_')
@@ -513,7 +513,7 @@
         h, ext = split_filename(header)
         if ext in hdrs_ext:
             if os.path.isfile(os.path.join(msc['cwd'], header+'.in')):
-                inf = '$(SRCDIR)\\%s.in' % header
+                inf = '$(srcdir)\\%s.in' % header
                 if inf not in msc['_IN']:
                     # TODO
                     # replace this hack by something like configure ...
@@ -521,10 +521,10 @@
                     fd.write('\t$(CONFIGURE) "%s" > "%s"\n' % (inf, header))
                     msc['_IN'].append(inf)
             elif os.path.isfile(os.path.join(msc['cwd'], header)):
-                fd.write('%s: "$(SRCDIR)\\%s"\n' % (header, header))
-##                fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, 
header))
-##                fd.write('\tif not exist "%s" if exist "$(SRCDIR)\\%s" 
$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, header, header, header))
-                fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (header, 
header))
+                fd.write('%s: "$(srcdir)\\%s"\n' % (header, header))
+##                fd.write('\t$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (header, 
header))
+##                fd.write('\tif not exist "%s" if exist "$(srcdir)\\%s" 
$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (header, header, header, header))
+                fd.write('\t$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (header, 
header))
             if headers.has_key('COND'):
                 condname = 'defined(' + ') && defined('.join(headers['COND']) 
+ ')'
                 mkname = header.replace('.', '_').replace('-', '_')
@@ -555,11 +555,11 @@
                 if os.path.isfile(os.path.join(msc['cwd'], i+'.in')):
                     # TODO
                     # replace this hack by something like configure ...
-                    fd.write('%s: "$(SRCDIR)\\%s.in"\n' % (i, i))
-                    fd.write('\t$(CONFIGURE) "$(SRCDIR)\\%s.in" > "%s"\n' % 
(i, i))
+                    fd.write('%s: "$(srcdir)\\%s.in"\n' % (i, i))
+                    fd.write('\t$(CONFIGURE) "$(srcdir)\\%s.in" > "%s"\n' % 
(i, i))
                 elif os.path.isfile(os.path.join(msc['cwd'], i)):
-                    fd.write('%s: "$(SRCDIR)\\%s"\n' % (i, i))
-                    fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (i, i))
+                    fd.write('%s: "$(srcdir)\\%s"\n' % (i, i))
+                    fd.write('\t$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (i, i))
                 msc['INSTALL'][i] = i, '', '$(bindir)', '', ''
         else: # link
             binmap = binmap[0]
@@ -1057,7 +1057,7 @@
     msc_deps(fd, libsmap['DEPS'], ".obj", msc)
 
 def msc_includes(fd, var, values, msc):
-    incs = "-I$(SRCDIR)"
+    incs = "-I$(srcdir)"
     for i in values:
         # replace all occurrences of @XXX@ with $(XXX)
         i = re.sub('@([A-Z_]+)@', r'$(\1)', i)
@@ -1086,11 +1086,11 @@
         fd.write('\tgem build %s\n' % f)
         for src in srcs:
             src = src.replace('/', '\\')
-            fd.write('%s: "$(SRCDIR)\\%s"\n' % (src, src))
+            fd.write('%s: "$(srcdir)\\%s"\n' % (src, src))
             if '\\' in src:
                 d = src[:src.rfind('\\')]
                 fd.write('\tif not exist "%s" $(MKDIR) "%s"\n' % (d, d))
-            fd.write('\t$(INSTALL) "$(SRCDIR)\\%s" "%s"\n' % (src, src))
+            fd.write('\t$(INSTALL) "$(srcdir)\\%s" "%s"\n' % (src, src))
         msc['INSTALL'][f] = f, '', '', '', 'defined(HAVE_RUBYGEM)'
         fd.write('install_%s: "%s" "%s"\n' % (f, f[:-4], rd))
         fd.write('\tgem install "%s" --local --install-dir "%s" --force 
--rdoc\n' % (f[:-4], rd))
@@ -1111,11 +1111,11 @@
         fd.write('target_python_%s: %s %s\n' % (f, ' '.join(srcs), f))
         fd.write('\t$(PYTHON) %s build\n' % f)
         for src in srcs:
-            fd.write('%s: "$(SRCDIR)\\%s"\n' % (src, src))
+            fd.write('%s: "$(srcdir)\\%s"\n' % (src, src))
             fd.write('\tif not exist "%s" $(MKDIR) "%s"\n' % (src, src))
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to