New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add premake-based build scripts #2
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
54a9fd5
initial commit
fd35595
Add a png comparison tool.
robryk 93e3668
Merge pull request #1 from robryk/compare-pngs
jyrkialakuijala c557fed
Fix comments. Remove an unused function.
robryk 52bdbaf
Add a Makefile.
robryk 9c9744a
Merge pull request #2 from robryk/random-stuff
jyrkialakuijala c2bee26
Tuning. Fix handling of transparency in compare_pngs.
robryk b94867e
Specify libpng dependency and build instructions
sbussard 26d3d9b
Merge pull request #4 from sbussard/patch-1
robryk 88897ab
Tuning. Update Butteraugli
lvandeve 1a3580d
Multiple changes impacting accuracy.
robryk 029f5b7
capitalize readme titles
lvandeve 2f8d6a0
Merge pull request #6 from google/readme
jyrkialakuijala 037eff7
color model refinements
jyrkialakuijala f093b4b
Add 'third_party/butteraugli/' from commit '037eff792f5b1cc7c21cc2cdd…
robryk 6f99b17
Change default build system to make.
robryk File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bin/ | ||
obj/ | ||
/bazel-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# GNU Make workspace makefile autogenerated by Premake | ||
|
||
.NOTPARALLEL: | ||
|
||
ifndef config | ||
config=release | ||
endif | ||
|
||
ifndef verbose | ||
SILENT = @ | ||
endif | ||
|
||
ifeq ($(config),release) | ||
guetzli_config = release | ||
endif | ||
ifeq ($(config),debug) | ||
guetzli_config = debug | ||
endif | ||
|
||
PROJECTS := guetzli | ||
|
||
.PHONY: all clean help $(PROJECTS) | ||
|
||
all: $(PROJECTS) | ||
|
||
guetzli: | ||
ifneq (,$(guetzli_config)) | ||
@echo "==== Building guetzli ($(guetzli_config)) ====" | ||
@${MAKE} --no-print-directory -C . -f guetzli.make config=$(guetzli_config) | ||
endif | ||
|
||
clean: | ||
@${MAKE} --no-print-directory -C . -f guetzli.make clean | ||
|
||
help: | ||
@echo "Usage: make [config=name] [target]" | ||
@echo "" | ||
@echo "CONFIGURATIONS:" | ||
@echo " release" | ||
@echo " debug" | ||
@echo "" | ||
@echo "TARGETS:" | ||
@echo " all (default)" | ||
@echo " clean" | ||
@echo " guetzli" | ||
@echo "" | ||
@echo "For more information, see http://industriousone.com/premake/quick-start" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
# GNU Make project makefile autogenerated by Premake | ||
|
||
ifndef config | ||
config=release | ||
endif | ||
|
||
ifndef verbose | ||
SILENT = @ | ||
endif | ||
|
||
.PHONY: clean prebuild prelink | ||
|
||
ifeq ($(config),release) | ||
RESCOMP = windres | ||
TARGETDIR = bin/Release | ||
TARGET = $(TARGETDIR)/guetzli | ||
OBJDIR = obj/Release | ||
DEFINES += -DGFLAGS_NAMESPACE=google | ||
INCLUDES += -I. -Ithird_party/butteraugli | ||
FORCE_INCLUDE += | ||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) | ||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 | ||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) -std=c++11 | ||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) | ||
LIBS += | ||
LDDEPS += | ||
ALL_LDFLAGS += $(LDFLAGS) -s -lpng -lgflags_nothreads | ||
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) | ||
define PREBUILDCMDS | ||
endef | ||
define PRELINKCMDS | ||
endef | ||
define POSTBUILDCMDS | ||
endef | ||
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) | ||
@: | ||
|
||
endif | ||
|
||
ifeq ($(config),debug) | ||
RESCOMP = windres | ||
TARGETDIR = bin/Debug | ||
TARGET = $(TARGETDIR)/guetzli | ||
OBJDIR = obj/Debug | ||
DEFINES += -DGFLAGS_NAMESPACE=google | ||
INCLUDES += -I. -Ithird_party/butteraugli | ||
FORCE_INCLUDE += | ||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) | ||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g | ||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) -std=c++11 | ||
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) | ||
LIBS += | ||
LDDEPS += | ||
ALL_LDFLAGS += $(LDFLAGS) -lpng -lgflags_nothreads | ||
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) | ||
define PREBUILDCMDS | ||
endef | ||
define PRELINKCMDS | ||
endef | ||
define POSTBUILDCMDS | ||
endef | ||
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) | ||
@: | ||
|
||
endif | ||
|
||
OBJECTS := \ | ||
$(OBJDIR)/butteraugli_comparator.o \ | ||
$(OBJDIR)/dct_double.o \ | ||
$(OBJDIR)/debug_print.o \ | ||
$(OBJDIR)/entropy_encode.o \ | ||
$(OBJDIR)/fdct.o \ | ||
$(OBJDIR)/gamma_correct.o \ | ||
$(OBJDIR)/guetzli.o \ | ||
$(OBJDIR)/idct.o \ | ||
$(OBJDIR)/jpeg_data.o \ | ||
$(OBJDIR)/jpeg_data_decoder.o \ | ||
$(OBJDIR)/jpeg_data_encoder.o \ | ||
$(OBJDIR)/jpeg_data_reader.o \ | ||
$(OBJDIR)/jpeg_data_writer.o \ | ||
$(OBJDIR)/jpeg_huffman_decode.o \ | ||
$(OBJDIR)/output_image.o \ | ||
$(OBJDIR)/preprocess_downsample.o \ | ||
$(OBJDIR)/processor.o \ | ||
$(OBJDIR)/quality.o \ | ||
$(OBJDIR)/quantize.o \ | ||
$(OBJDIR)/score.o \ | ||
$(OBJDIR)/butteraugli.o \ | ||
|
||
RESOURCES := \ | ||
|
||
CUSTOMFILES := \ | ||
|
||
SHELLTYPE := msdos | ||
ifeq (,$(ComSpec)$(COMSPEC)) | ||
SHELLTYPE := posix | ||
endif | ||
ifeq (/bin,$(findstring /bin,$(SHELL))) | ||
SHELLTYPE := posix | ||
endif | ||
|
||
$(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | ||
@echo Linking guetzli | ||
$(SILENT) $(LINKCMD) | ||
$(POSTBUILDCMDS) | ||
|
||
$(TARGETDIR): | ||
@echo Creating $(TARGETDIR) | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) mkdir -p $(TARGETDIR) | ||
else | ||
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) | ||
endif | ||
|
||
$(OBJDIR): | ||
@echo Creating $(OBJDIR) | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) mkdir -p $(OBJDIR) | ||
else | ||
$(SILENT) mkdir $(subst /,\\,$(OBJDIR)) | ||
endif | ||
|
||
clean: | ||
@echo Cleaning guetzli | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) rm -f $(TARGET) | ||
$(SILENT) rm -rf $(OBJDIR) | ||
else | ||
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) | ||
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) | ||
endif | ||
|
||
prebuild: | ||
$(PREBUILDCMDS) | ||
|
||
prelink: | ||
$(PRELINKCMDS) | ||
|
||
ifneq (,$(PCH)) | ||
$(OBJECTS): $(GCH) $(PCH) | ||
$(GCH): $(PCH) | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" | ||
endif | ||
|
||
$(OBJDIR)/butteraugli_comparator.o: guetzli/butteraugli_comparator.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/dct_double.o: guetzli/dct_double.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/debug_print.o: guetzli/debug_print.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/entropy_encode.o: guetzli/entropy_encode.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/fdct.o: guetzli/fdct.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/gamma_correct.o: guetzli/gamma_correct.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/guetzli.o: guetzli/guetzli.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/idct.o: guetzli/idct.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_data.o: guetzli/jpeg_data.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_data_decoder.o: guetzli/jpeg_data_decoder.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_data_encoder.o: guetzli/jpeg_data_encoder.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_data_reader.o: guetzli/jpeg_data_reader.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_data_writer.o: guetzli/jpeg_data_writer.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/jpeg_huffman_decode.o: guetzli/jpeg_huffman_decode.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/output_image.o: guetzli/output_image.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/preprocess_downsample.o: guetzli/preprocess_downsample.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/processor.o: guetzli/processor.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/quality.o: guetzli/quality.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/quantize.o: guetzli/quantize.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/score.o: guetzli/score.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
$(OBJDIR)/butteraugli.o: third_party/butteraugli/butteraugli/butteraugli.cc | ||
@echo $(notdir $<) | ||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" | ||
|
||
-include $(OBJECTS:%.o=%.d) | ||
ifneq (,$(PCH)) | ||
-include $(OBJDIR)/$(notdir $(PCH)).d | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
workspace "guetzli" | ||
configurations { "Release", "Debug" } | ||
|
||
flags { "C++11" } | ||
|
||
filter "configurations:Debug" | ||
symbols "On" | ||
filter "configurations:Release" | ||
optimize "Full" | ||
|
||
project "guetzli" | ||
kind "ConsoleApp" | ||
language "C++" | ||
nuget { "gflags:2.1.2.1", "libpng:1.6.26.1" } | ||
includedirs { ".", "third_party/butteraugli" } | ||
linkoptions { "-lpng", "-lgflags_nothreads" } | ||
-- This should work with gflags 2.x. The gflags namespace is absent in | ||
-- gflags-2.0, which is the version in Ubuntu Trusty package repository. | ||
defines { "GFLAGS_NAMESPACE=google" } | ||
files | ||
{ | ||
"guetzli/*.cc", | ||
"guetzli/*.h", | ||
"third_party/butteraugli/butteraugli/butteraugli.cc", | ||
"third_party/butteraugli/butteraugli/butteraugli.h" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cc_library( | ||
name = "butteraugli_lib", | ||
srcs = [ | ||
"butteraugli/butteraugli.cc", | ||
"butteraugli/butteraugli.h", | ||
], | ||
hdrs = [ | ||
"butteraugli/butteraugli.h", | ||
], | ||
copts = ["-Wno-sign-compare"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_binary( | ||
name = "butteraugli", | ||
srcs = ["butteraugli/butteraugli_main.cc"], | ||
copts = ["-Wno-sign-compare"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
":butteraugli_lib", | ||
"@jpeg_archive//:jpeg", | ||
"@png_archive//:png", | ||
], | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is the expected state here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean first line is padded by 3 spaces here, not 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a github bug - it is ok in downloaded sources.