Commit 87c716bf authored by LYMB Demo's avatar LYMB Demo
Browse files

now with depend targets

parent 05dc3b8f
This diff is collapsed.
#include <sys\types.h>
#include <sys\stat.h>
#include <string.h>
#include <fstream.h>
#include <stdio.h>
static char depends[100][256];
static char names[100][256];
static int num;
void GetDepends(char *file, const char *vtkHome);
void CheckAndAdd(char *name, const char *vtkHome)
{
char fname[512];
struct stat statBuff;
// does the file exist ?
// search for it in the vtk src code
sprintf(fname,"%s\\common\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"common\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\graphics\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"graphics\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\imaging\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"imaging\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\contrib\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"contrib\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\patented\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"patented\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\volume\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"volume\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
// if control reaches here then it hasn't been found yet
sprintf(fname,"%s\\gemsvolume\\%s",vtkHome,name);
if (!stat(fname,&statBuff))
{
// add this to the depend list
sprintf(depends[num],"gemsvolume\\%s",name);
strcpy(names[num],name);
num++;
// now recurse
GetDepends(fname,vtkHome);
return;
}
}
void GetDepends(char *file, const char *vtkHome)
{
ifstream *IS;
char line[256];
int present, j, k;
char name[256];
IS = new ifstream(file);
// search for includes
while (!IS->eof())
{
IS->getline(line,255);
// do we have an include
if (!strncmp(line,"#include",8))
{
// is it a quoted include
for (j = 8; j < (int)strlen(line); j++)
{
if (line[j] == '<') j = 1000;
else
{
if (line[j] == '"')
{
// we found a quoted include, process it
// make sure it is a vtk include file
if (!strncmp(line +j +1,"vtk",3))
{
// extract the class name
// there should always be an end quote or this will die
for (k = 0; line[j+k+1] != '"'; k++)
{
name[k] = line[j+k+1];
}
name[k] = '\0';
// make this isn't already in the list
present = 0;
for (k = 0; k < num; k++)
{
if (!strcmp(name,names[k])) present = 1;
}
// check and see if the file exists and add it
// this will also recurse if the file exists
if (!present) CheckAndAdd(name,vtkHome);
}
else j = 1000;
}
} // end if line[j] == '<' and else
} // end for j = 8 ... strlen(line)
} // end if (!strncmp(line,"#include"))
} // end while
delete IS;
}
extern void OutputDepends(char *file, FILE *fp, const char *vtkHome)
{
int i;
fprintf(fp,"DEPENDS=\\\n");
num = 0;
GetDepends(file,vtkHome);
// now output the results
for (i = 0; i < num; i++)
{
fprintf(fp," \"%s\\%s\"\\\n",vtkHome,depends[i]);
}
fprintf(fp,"\n");
}
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.10
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
......@@ -67,6 +67,7 @@ ALL : "java_wrap - Win32 Release" "java_parse - Win32 Release"\
CLEAN :
-@erase "$(INTDIR)\getclasses.obj"
-@erase "$(INTDIR)\makedepend.obj"
-@erase "$(INTDIR)\pcmaker.obj"
-@erase "$(INTDIR)\pcmaker.pch"
-@erase "$(INTDIR)\pcmaker.res"
......@@ -125,6 +126,7 @@ LINK32_FLAGS=/nologo /subsystem:windows /incremental:no\
/pdb:"$(OUTDIR)/pcmaker.pdb" /machine:I386 /out:"$(OUTDIR)/pcmaker.exe"
LINK32_OBJS= \
"$(INTDIR)\getclasses.obj" \
"$(INTDIR)\makedepend.obj" \
"$(INTDIR)\pcmaker.obj" \
"$(INTDIR)\pcmaker.res" \
"$(INTDIR)\pcmakerDlg.obj" \
......@@ -155,6 +157,7 @@ ALL : "java_wrap - Win32 Debug" "java_parse - Win32 Debug"\
CLEAN :
-@erase "$(INTDIR)\getclasses.obj"
-@erase "$(INTDIR)\makedepend.obj"
-@erase "$(INTDIR)\pcmaker.obj"
-@erase "$(INTDIR)\pcmaker.pch"
-@erase "$(INTDIR)\pcmaker.res"
......@@ -217,6 +220,7 @@ LINK32_FLAGS=/nologo /subsystem:windows /incremental:yes\
/pdb:"$(OUTDIR)/pcmaker.pdb" /debug /machine:I386 /out:"$(OUTDIR)/pcmaker.exe"
LINK32_OBJS= \
"$(INTDIR)\getclasses.obj" \
"$(INTDIR)\makedepend.obj" \
"$(INTDIR)\pcmaker.obj" \
"$(INTDIR)\pcmaker.res" \
"$(INTDIR)\pcmakerDlg.obj" \
......@@ -862,6 +866,15 @@ DEP_CPP_GETCL=\
!ENDIF
# End Project Dependency
################################################################################
# Begin Source File
SOURCE=.\makedepend.cxx
"$(INTDIR)\makedepend.obj" : $(SOURCE) "$(INTDIR)"
# End Source File
# End Target
################################################################################
# Begin Target
......@@ -879,6 +892,19 @@ DEP_CPP_GETCL=\
# Begin Source File
SOURCE=..\tcl\y.tab.c
!IF "$(CFG)" == "cpp_parse - Win32 Release"
DEP_CPP_Y_TAB=\
"..\tcl\lex.yy.c"\
"$(INTDIR)\y.tab.obj" : $(SOURCE) $(DEP_CPP_Y_TAB) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ELSEIF "$(CFG)" == "cpp_parse - Win32 Debug"
DEP_CPP_Y_TAB=\
"..\tcl\lex.yy.c"\
......@@ -887,6 +913,8 @@ DEP_CPP_Y_TAB=\
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
# End Source File
# End Target
################################################################################
......
......@@ -72,14 +72,14 @@ IDR_MAINFRAME ICON DISCARDABLE "res\\pcmaker.ico"
// Dialog
//
IDD_PCMAKER_DIALOG DIALOGEX 0, 0, 185, 261
IDD_PCMAKER_DIALOG DIALOGEX 0, 0, 185, 290
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "pcmaker"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,31,240,50,14
PUSHBUTTON "Cancel",IDCANCEL,97,240,50,14
DEFPUSHBUTTON "OK",IDOK,31,269,50,14
PUSHBUTTON "Cancel",IDCANCEL,97,269,50,14
GROUPBOX "What Compiler",IDC_COMPILER,7,125,171,25,WS_TABSTOP
EDITTEXT IDC_WHEREVTK,16,15,155,14,ES_AUTOHSCROLL
LTEXT "Where is vtk installed",IDC_STATIC,7,7,65,8
......@@ -112,6 +112,9 @@ BEGIN
LTEXT "Where is your Java JDK (this is optional)",IDC_STATIC,
10,93,141,13
EDITTEXT IDC_WHEREJDK,16,105,153,15,ES_AUTOHSCROLL
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,
7,249,171,14
LTEXT "Progress",IDC_STATIC,7,239,77,11
END
......@@ -171,7 +174,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 178
TOPMARGIN, 7
BOTTOMMARGIN, 254
BOTTOMMARGIN, 283
END
END
#endif // APSTUDIO_INVOKED
......
......@@ -44,19 +44,20 @@ void CPcmakerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPcmakerDlg)
DDX_Control(pDX, IDC_PROGRESS1, m_Progress);
DDX_Text(pDX, IDC_WHEREVTK, m_WhereVTK);
DDV_MaxChars(pDX, m_WhereVTK, 80);
DDX_Text(pDX, IDC_WHEREBUILD, m_WhereBuild);
DDV_MaxChars(pDX, m_WhereBuild, 80);
DDX_Text(pDX, IDC_WHERECOMPILER, m_WhereCompiler);
DDV_MaxChars(pDX, m_WhereCompiler, 40);
DDX_Text(pDX, IDC_WHEREJDK, m_WhereJDK);
DDV_MaxChars(pDX, m_WhereJDK, 40);
DDX_Check(pDX, IDC_MSCOMP, m_MSComp);
DDX_Check(pDX, IDC_BORLANDCOMP, m_BorlandComp);
DDX_Check(pDX, IDC_MSCOMP, m_MSComp);
DDX_Check(pDX, IDC_Contrib, m_Contrib);
DDX_Check(pDX, IDC_Graphics, m_Graphics);
DDX_Check(pDX, IDC_Imaging, m_Imaging);
DDX_Text(pDX, IDC_WHERECOMPILER, m_WhereCompiler);
DDV_MaxChars(pDX, m_WhereCompiler, 40);
DDX_Check(pDX, IDC_Debug, m_Debug);
DDX_Check(pDX, IDC_GEMSIO, m_GEMSIO);
DDX_Check(pDX, IDC_GEMSIP, m_GEMSIP);
......@@ -80,7 +81,7 @@ BOOL CPcmakerDlg::OnInitDialog()
this->m_WhereBuild = "C:\\vtkbin";
this->m_WhereVTK = "C:\\vtk";
this->m_WhereCompiler = "C:\\msdev";
this->m_WhereJDK = "C:\\JDK1.1";
this->m_WhereJDK = "";
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
......
......@@ -13,6 +13,7 @@ public:
// Dialog Data
//{{AFX_DATA(CPcmakerDlg)
enum { IDD = IDD_PCMAKER_DIALOG };
CProgressCtrl m_Progress;
CString m_WhereVTK;
CString m_WhereBuild;
CString m_WhereJDK;
......
......@@ -23,6 +23,7 @@
#define IDC_GEMSVOLUME 1020
#define IDC_CHECK5 1021
#define IDC_PATENTED 1022
#define IDC_PROGRESS1 1024
// Next default values for new objects
//
......@@ -30,7 +31,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1024
#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment