Skip to content

Commit

Permalink
Build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa committed Feb 18, 2015
1 parent e166ece commit 7cc143d
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 47 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@

VER?=$(shell perl -n -e '/define\s+VER_STRING2\s+"(.*)"/ && print $$1' version.h)
APP?=$(shell perl -n -e '/define\s+VER_INTERNAL_NAME\s+"(.*)"/ && print $$1' version.h)
VC98?=$(PROGRAMFILES)\\Microsoft Visual Studio\\VC98
MSVC_DIR?=$(shell cygpath -u `cygpath -ds "$(VC98)"`)
CYGENV=MAKEFLAGS="" PATH=$(MSVC_DIR)/bin:$$PATH
APP_FILES=Release/$(APP).exe changelog.txt COPYING readme.txt
SRC_FILES=$(APP_FILES) $(shell ls Makefile *.cpp *.dep *.dsp *.dsw *.h *.ico *.mak *.rc 2>/dev/null)

APP_ZIP?=$(APP)-$(VER)-win32.zip
SRC_ZIP?=$(APP)-$(VER)-win32-src.zip
ZIP?=zip
ZIP_OPTS?=-9quX
CWD=$(shell pwd)
APP_FILES=Release/$(APP).exe Debug/$(APP).exe changelog.txt COPYING readme.txt
SRC_FILES=$(APP_FILES) $(shell ls *.cpp *.c *.h *.hpp *.inl *.dsp *.dsw *.mak *.dep *.vcxproj Makefile *.ico *.rc ../shared/shared-1.2-win32-src.zip 2>nul)
ZIP_OPTS?=-9jquX

.PHONY: dist
dist: all $(APP_ZIP) $(SRC_ZIP)
Expand All @@ -40,7 +37,7 @@ $(SRC_ZIP): $(SRC_FILES)

.PHONY: install
install: all
cp -pf Debug/$(APP).exe /cygdrive/c/bin
cp -pf Debug/$(APP).exe $(WINDIR)

.PHONY: distclean
distclean: clean
Expand Down
20 changes: 18 additions & 2 deletions lsdsk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ Available: F: G: I: K: Y:
*/

#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif

#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
#endif
Expand Down Expand Up @@ -800,11 +804,21 @@ int main(int argc, char **argv) {
busTypes[BusTypeiScsi] = "iSCSI";
busTypes[BusTypeSas] = "SAS";
busTypes[BusTypeSata] = "SATA";
#ifdef BusTypeSd
busTypes[BusTypeSd] = "SD";
#endif
#ifdef BusTypeMmc
busTypes[BusTypeMmc] = "MMC";
#endif
#ifdef BusTypeVirtual
busTypes[BusTypeVirtual] = "Virtual";
#endif
#ifdef BusTypeFileBackedVirtual
busTypes[BusTypeFileBackedVirtual] = "vFile";
#endif
#ifdef BusTypeMax
busTypes[BusTypeMax] = "Max";
#endif

unsigned int width[8];

Expand Down Expand Up @@ -979,7 +993,7 @@ int main(int argc, char **argv) {

if (opt.domain) {
drive[index].name += " (";

if (ui->ui2_domainname) {
char *domainname = (char*) malloc(wcslen(ui->ui2_domainname) * sizeof(char));
len = WideCharToMultiByte(CP_ACP, 0, ui->ui2_domainname, -1, domainname, sizeof(arg), NULL, NULL);
Expand Down Expand Up @@ -1083,6 +1097,7 @@ int main(int argc, char **argv) {
if ( hDevice != INVALID_HANDLE_VALUE ) {

DWORD dwOutBytes = 0; // IOCTL output length
#ifdef STORAGE_PROPERTY_QUERY
STORAGE_PROPERTY_QUERY Query; // input param for query

// specify the query type
Expand All @@ -1093,7 +1108,7 @@ int main(int argc, char **argv) {
PSTORAGE_DEVICE_DESCRIPTOR pDevDesc = (PSTORAGE_DEVICE_DESCRIPTOR)OutBuf;
pDevDesc->Size = sizeof(OutBuf);

// Query using IOCTL_STORAGE_QUERY_PROPERTY
// Query using IOCTL_STORAGE_QUERY_PROPERTY
BOOL res = DeviceIoControl(hDevice, // device handle
IOCTL_STORAGE_QUERY_PROPERTY, // info of device property
&Query, sizeof(STORAGE_PROPERTY_QUERY), // input data buffer
Expand All @@ -1109,6 +1124,7 @@ int main(int argc, char **argv) {
drive[i].bus = busTypes[pDevDesc->BusType];
}
}
#endif
}
}

Expand Down
15 changes: 9 additions & 6 deletions lsdsk.dep
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Microsoft Developer Studio Generated Dependency File, included by lsdsk.mak

.\lsdsk.cpp : \
".\version.h"\
{$(INCLUDE)}"basetsd.h"\
{$(INCLUDE)}"guiddef.h"\
{$(INCLUDE)}"lmjoin.h"\
{$(INCLUDE)}"reason.h"\
{$(INCLUDE)}"specstrings.h"\
{$(INCLUDE)}"stralign.h"\
{$(INCLUDE)}"tvout.h"\
{$(INCLUDE)}"debug.h"\
{$(INCLUDE)}"getopt.h"\
{$(INCLUDE)}"Optimize.h"\
{$(INCLUDE)}"Stackwalker.h"\
{$(INCLUDE)}"SystemMessage.h"\
{$(INCLUDE)}"systemmessage.h"\
{$(INCLUDE)}"ver_defaults.h"\
".\version.h"\


.\lsdsk.rc : \
".\lsdsk.ico"\
".\version.h"\
{$(INCLUDE)}"ver_defaults.h"\

85 changes: 59 additions & 26 deletions lsdsk.mak
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ NULL=
NULL=nul
!ENDIF

CPP=cl.exe
RSC=rc.exe

!IF "$(CFG)" == "lsdsk - Win32 Release"

OUTDIR=.\Release
Expand All @@ -48,7 +45,40 @@ CLEAN :
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP=cl.exe
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\lsdsk.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c

.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<

RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\lsdsk.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\lsdsk.bsc"
Expand Down Expand Up @@ -90,30 +120,8 @@ CLEAN :
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"

CPP=cl.exe
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\lsdsk.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\lsdsk.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\lsdsk.bsc"
BSC32_SBRS= \
"$(INTDIR)\lsdsk.sbr"

"$(OUTDIR)\lsdsk.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<

LINK32=link.exe
LINK32_FLAGS=sharedd.lib Setupapi.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\lsdsk.pdb" /debug /machine:I386 /out:"$(OUTDIR)\lsdsk.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\lsdsk.obj" \
"$(INTDIR)\lsdsk.res"

"$(OUTDIR)\lsdsk.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ENDIF

.c{$(INTDIR)}.obj::
$(CPP) @<<
Expand Down Expand Up @@ -145,6 +153,31 @@ LINK32_OBJS= \
$(CPP_PROJ) $<
<<

RSC=rc.exe
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\lsdsk.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\lsdsk.bsc"
BSC32_SBRS= \
"$(INTDIR)\lsdsk.sbr"

"$(OUTDIR)\lsdsk.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<

LINK32=link.exe
LINK32_FLAGS=sharedd.lib Setupapi.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\lsdsk.pdb" /debug /machine:I386 /out:"$(OUTDIR)\lsdsk.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\lsdsk.obj" \
"$(INTDIR)\lsdsk.res"

"$(OUTDIR)\lsdsk.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<

!ENDIF


!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("lsdsk.dep")
Expand Down
2 changes: 1 addition & 1 deletion lsdsk.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
//#include "afxres.h"
#include "windows.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand Down
8 changes: 4 additions & 4 deletions nmake.mak
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
all:
$(CYGENV) nmake /f lsdsk.mak CFG="lsdsk - Win32 Release" all
$(CYGENV) nmake /f lsdsk.mak CFG="lsdsk - Win32 Debug" all
$(MAKE)/f lsdsk.mak CFG="lsdsk - Win32 Release" all
$(MAKE)/f lsdsk.mak CFG="lsdsk - Win32 Debug" all

clean:
$(CYGENV) nmake /f lsdsk.mak CFG="lsdsk - Win32 Release" clean
$(CYGENV) nmake /f lsdsk.mak CFG="lsdsk - Win32 Debug" clean
$(MAKE)/f lsdsk.mak CFG="lsdsk - Win32 Release" clean
$(MAKE)/f lsdsk.mak CFG="lsdsk - Win32 Debug" clean

realclean: clean
-cmd /c del /s *.bak
Expand Down

0 comments on commit 7cc143d

Please sign in to comment.