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 cc2a579 commit 979f15d
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 239 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.2 (unreleased)
## 1.0 (unreleased)

* Updated to Visual Studio 2013
* Switch to MIT license
Expand Down
29 changes: 10 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Makefile to build getjpegs
# Copyright (c) 2004-2006 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$
# time_it

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,18 +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: 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
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 time_it.sln /t:Rebuild

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

realclean: clean
-cmd /c del /s *.bak *.bsc *.idb *.pdb *.lib *.ncb *.obj *.opt *.pch *.plg *.sbr
14 changes: 3 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 time_it.mak CFG="time_it - Win32 Release" all
$(MAKE) /f time_it.mak CFG="time_it - Win32 Debug" all
Expand All @@ -7,14 +9,4 @@ clean:
$(MAKE) /f time_it.mak CFG="time_it - 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
8 changes: 7 additions & 1 deletion time_it.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ int main(int argc, char * argv[]) {

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

if (opterr) {
usage(1);
}

if (c == -1)
break;

Expand Down Expand Up @@ -778,7 +782,9 @@ int main(int argc, char * argv[]) {
++opt.help;
break;
default:
fprintf(stderr, "Invalid option: '%s'\n", optarg);
if (optarg) {
fprintf(stderr, "Invalid option: '%s'\n", optarg);
}
usage(1);
}
}
Expand Down
Loading

0 comments on commit 979f15d

Please sign in to comment.