Skip to content

Commit

Permalink
Build fixes, getopt workarounds, bumped versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rasa committed Feb 19, 2015
1 parent 6f1bb13 commit e6d0f12
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 34 deletions.
33 changes: 10 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Makefile to build lsdsk
# Copyright (c) 2004-2011 Ross Smith II (http://smithii.com). All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# $Id$
# lsdsk

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)
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_FILES=CHANGELOG.md LICENSE README.md $(wildcard Release/*.exe)
SRC_FILES=$(APP_FILES) $(wildcard Makefile *.cpp *.dep *.dsp *.dsw *.h *.ico *.mak *.rc *.sln *.vcproj *.vcxproj *.vcxproj.filters)


APP_ZIP?=$(APP)-$(VER)-win32.zip
SRC_ZIP?=$(APP)-$(VER)-win32-src.zip
Expand All @@ -27,22 +16,20 @@ dist: all $(APP_ZIP) $(SRC_ZIP)

$(APP_ZIP): $(APP_FILES)
-rm -f $(APP_ZIP)
chmod a+x $^
chmod +x $^
${ZIP} ${ZIP_OPTS} $@ $^

$(SRC_ZIP): $(SRC_FILES)
-rm -f $(SRC_ZIP)
chmod a+x $^
chmod +x $^
${ZIP} ${ZIP_OPTS} $@ $^

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

.PHONY: distclean
distclean: clean
rm -f $(APP_ZIP) $(SRC_ZIP)

.PHONY: all clean realclean

ifneq (,$(shell which MSBuild.exe 2>/dev/null))
include msbuild.mak
else
include nmake.mak
endif
5 changes: 5 additions & 0 deletions lsdsk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,11 @@ int process_options(int argc, char **argv) {

c = getopt_long(argc, argv, short_options, long_options, &option_index);

if (opterr) {
usage();
exit(1);
}

if (c == -1)
break;

Expand Down
10 changes: 10 additions & 0 deletions msbuild.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: all clean realclean

all:
MSBuild.exe lsdsk.sln /t:Rebuild

clean:
MSBuild.exe lsdsk.sln /t:Clean

realclean: clean
-cmd /c del /s *.bak *.bsc *.idb *.pdb *.lib *.ncb *.obj *.opt *.pch *.plg *.sbr
15 changes: 4 additions & 11 deletions nmake.mak
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY: all clean realclean

all:
$(MAKE) /f lsdsk.mak CFG="lsdsk - Win32 Release" all
$(MAKE) /f lsdsk.mak CFG="lsdsk - Win32 Debug" all
Expand All @@ -7,14 +9,5 @@ clean:
$(MAKE) /f lsdsk.mak CFG="lsdsk - Win32 Debug" clean

realclean: clean
-cmd /c del /s *.bak
-cmd /c del /s *.bsc
-cmd /c del /s *.idb
-cmd /c del /s *.pdb
-cmd /c del /s *.lib
-cmd /c del /s *.ncb
-cmd /c del /s *.obj
-cmd /c del /s *.opt
-cmd /c del /s *.pch
-cmd /c del /s *.plg
-cmd /c del /s *.sbr
-cmd /c del /s *.bak *.bsc *.idb *.pdb *.lib *.ncb *.obj *.opt *.pch *.plg *.sbr

0 comments on commit e6d0f12

Please sign in to comment.