Convert the build system to non-recursive make

Speeds up a no-op build from 500ms to 60ms and significantly improves
dependency tracking.
This commit is contained in:
Thomas Goyne 2014-06-16 18:22:06 -07:00
parent cb71a3d05d
commit 68eaab0f43
33 changed files with 536 additions and 845 deletions

View file

@ -1,17 +1,4 @@
include Makefile.inc
SUBDIRS += \
packages/desktop \
vendor/luajit \
vendor/universalchardet \
vendor/luabins \
libaegisub \
tools \
src \
automation \
po
all: ;
include header.mk
ifeq (yes, $(BUILD_DARWIN))
osx-bundle:
@ -22,16 +9,4 @@ osx-dmg: osx-bundle
$(BIN_SHELL) tools/osx-dmg.sh "$(BUILD_VERSION_STRING)"
endif
DISTCLEANFILES += \
acconf.h \
configure \
acconf.h.in~ \
build/git_version.h \
Makefile.inc \
config.log \
acconf.h.in \
config.status \
autom4te.cache \
aclocal.m4 \
include Makefile.target

View file

@ -9,13 +9,16 @@ HAVE_PORTAUDIO = @with_portaudio@
HAVE_FFMS2 = @with_ffms2@
HAVE_LIBPULSE = @with_libpulse@
##############
# BUILD OUTPUT
##############
PROGRAM := $(PROGRAM)
LIB := $(LIB)
###################
# PLATFORM SETTINGS
###################
BUILD_BSD = @build_bsd@
BUILD_DARWIN = @build_darwin@
BUILD_DEFAULT = @build_default@
BUILD_LINUX = @build_linux@
#######
# FLAGS
@ -23,7 +26,7 @@ BUILD_LINUX = @build_linux@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
CFLAGS_DEP = -MD -MP
CFLAGS_DEP = -MMD -MP
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
INSTALL_FLAGS = -m 664
@ -36,27 +39,18 @@ LIB_SHARED_LINK_OSX = -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -compatibili
AEGISUB_COMMAND = @AEGISUB_COMMAND@
AEGISUB_CATALOG = @AEGISUB_CATALOG@
BUILD_DATE = @BUILD_DATE@
PACKAGE_TARNAME = aegisub-@BUILD_GIT_VERSION_STRING@
PACKAGE_DEBUG = @PACKAGE_DEBUG@
BUILD_VERSION_STRING = @BUILD_GIT_VERSION_STRING@
#######
# PATHS
#######
P_PREFIX = @prefix@
prefix = ${P_PREFIX}
P_PREFIX_EXEC = @exec_prefix@
exec_prefix = ${P_PREFIX_EXEC}
P_BINDIR = @bindir@
P_SBINDIR = @sbindir@
P_LIBEXEC = @libexecdir@
P_DATAROOT = @datarootdir@
datarootdir = ${P_DATAROOT}
P_SYSCONF = @sysconfdir@
P_SHAREDSTATE = @sharedstatedir@
P_LOCALSTATE = @localstatedir@
P_INCLUDE = @includedir@
P_LIB = @libdir@
P_PREFIX = @prefix@
P_PREFIX_EXEC = @exec_prefix@
P_BINDIR = @bindir@
P_DATAROOT = @datarootdir@
P_LOCALE = @localedir@
P_DESKTOP = @P_DESKTOP@
@ -83,14 +77,13 @@ CFLAGS_HUNSPELL = @HUNSPELL_CFLAGS@
CFLAGS_ICONV = @ICONV_CFLAGS@
CFLAGS_ICU = @ICU_I18N_CFLAGS@
CFLAGS_LIBASS = @LIBASS_CFLAGS@
CFLAGS_LIBCURL = @LIBCURL_CFLAGS@
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
CFLAGS_LUA = -I../vendor/luajit/include
CFLAGS_LUA = -I$(TOP)vendor/luajit/include
CFLAGS_OPENAL = @OPENAL_CFLAGS@
CFLAGS_OSS = @OSS_CFLAGS@
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
CFLAGS_PTHREAD = @PTHREAD_CFLAGS@
CFLAGS_UCHARDET = -I../vendor/universalchardet
CFLAGS_UCHARDET = -I$(TOP)vendor/universalchardet
LIBS_ALSA = @ALSA_LIBS@
LIBS_FFMS2 = @FFMS2_LIBS@
@ -102,23 +95,20 @@ LIBS_HUNSPELL = @HUNSPELL_LIBS@
LIBS_ICONV = @ICONV_LIBS@
LIBS_ICU = @ICU_UC_LIBS@ @ICU_I18N_LIBS@
LIBS_LIBASS = @LIBASS_LIBS@
LIBS_LIBCURL = @LIBCURL_LIBS@
LIBS_LIBPULSE = @LIBPULSE_LIBS@
LIBS_LUA = ../vendor/luajit/src/libluajit.a
LIBS_LUA = $(TOP)vendor/luajit/src/libluajit.a
LIBS_OPENAL = @OPENAL_LIBS@
LIBS_PORTAUDIO = @PORTAUDIO_LIBS@
LIBS_PTHREAD = @PTHREAD_LIBS@
LIBS_UCHARDET ?= ../vendor/universalchardet/libuniversalchardet.a
ifeq (yes, $(BUILD_DARWIN))
LIBS_LUA = ../vendor/luajit/src/libluajit-aegisub.so
LIBS_LUA = $(TOP)vendor/luajit/src/libluajit-aegisub.so
endif
#####################
# DEBUG / DEVELOPMENT
#####################
PRECOMPILED_HEADER = @enable_gcc_prec@
ENABLE_REPORTER = @ENABLE_REPORTER@
##########
# BINARIES
@ -141,6 +131,4 @@ BIN_MKDIR = mkdir
BIN_MKDIR_P = mkdir -p
BIN_ECHO = echo
BIN_TOUCH = touch
BIN_TAR = tar
BIN_GZIP = gzip
BIN_WX_CONFIG = @WX_CONFIG_PATH@

View file

@ -1,23 +1,9 @@
# *** THERE ARE NO USER-EDITABLE ITEMS HERE. ***
#
# TODO:
# * Allow variables to be overridden on the CL.
.PHONY: all install clean subdirs $(SUBDIRS)
all: subdirs $(PROGRAM)
ifneq (yes, $(INCLUDING_CHILD_MAKEFILES))
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg
.PHONY: $(COMMANDS)
.DEFAULT_GOAL := all
ifneq (no, $(BUILD_LIB))
all: $(LIB) $(LIB_SHARED)
endif
OBJ = $(addsuffix .o, $(basename $(SRC)))
DEP = $(addsuffix .d, $(basename $(SRC)))
###################
# PLATFORM SPECIFIC
###################
# Would be nice to move this somewhere else (Makefile.inc?)
ifeq (yes, $(BUILD_DARWIN))
CFLAGS += -mmacosx-version-min=10.7 -gfull
CXXFLAGS += -mmacosx-version-min=10.7 -gfull
@ -25,161 +11,111 @@ LDFLAGS += -mmacosx-version-min=10.7 -Wl,-dead_strip -pagezero_size 10000 -image
LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX)
endif
LIB_TARGETS := $(addprefix $(TOP)lib/,$(LIB:%=lib%.a))
###########
# LIBRARIES
###########
$(LIB) : $(OBJ)
$(BIN_AR) cru $@ $(OBJ)
$(BIN_RANLIB) $@
# Handle per-target flags in the form foo_CFLAGS := -w by mapping them to all
# of the objects a target depends on. This has potentially dumb results if
# multiple targets use a single object file, so don't do that.
define set_target_flags
OBJ += $($1_OBJ)
ifdef LIB_SHARED
LIB_SHARED_FULL = $(LIB_SHARED).$(LIB_VERSION)
$(LIB_SHARED) : $(OBJ)
$(BIN_CXX) $(LIB_SHARED_LINK) $(LDFLAGS) $(OBJ) $(LIBS) -o $(LIB_SHARED_FULL)
$(BIN_LN) -sf $(LIB_SHARED_FULL) $(LIB_SHARED)
$($1_OBJ): CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS)
$($1_OBJ): CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
$($1_OBJ): OBJCXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
CLEANFILES+= $(LIB_SHARED_FULL)
ifeq (yes, $(PRECOMPILED_HEADER))
ifdef $1_PCH
CLEANFILES += $($1_PCH).gch
$($1_OBJ): CXXFLAGS += -include $($1_PCH) $(PCHFLAGS)
$($1_OBJ): $($1_PCH).gch
$($1_PCH).gch: $($1_PCH)
$($1_PCH).gch: CPPFLAGS := $(CPPFLAGS) $($1_CPPFLAGS)
$($1_PCH).gch: CXXFLAGS := $(CXXFLAGS) $($1_CXXFLAGS)
else
$($1_OBJ): CXXFLAGS += -include acconf.h
endif
else
$($1_OBJ): CXXFLAGS += -include acconf.h
endif
endef
$(foreach target,$(LIB),$(eval $(call set_target_flags,$(target),$(TOP)lib/lib$(target).a)))
$(foreach target,$(PROGRAM),$(eval $(call set_target_flags,$(notdir $(target)),$(target))))
# Create the build and install targets for programs
# Not done with a pattern rule since the pattern would be just %: and doing that
# leads to make trying to use gcc to make any nonexistent targets rather than
# erroring
define create_program_targets
ifdef $1_INSTALLNAME
install: $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME)
$(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME): $(dir $2)$($1_INSTALLNAME)
@$(BIN_MKDIR) -p $(DESTDIR)$(P_BINDIR)
@$(BIN_INSTALL) $(dir $2)$($1_INSTALLNAME) $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME)
$(dir $2)$($1_INSTALLNAME): $($1_OBJ)
$(BIN_CXX) -o $(dir $2)$($1_INSTALLNAME) $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS)
all: $(dir $2)$($1_INSTALLNAME)
else
$2: $($1_OBJ)
$(BIN_CXX) -o $2 $(LDFLAGS) $($1_OBJ) $(LIBS) $($1_LIBS)
all: $2
endif
$(eval CLEANFILES += $(filter-out %/,$2 $(dir $2)$($1_INSTALLNAME)))
endef
$(foreach target,$(PROGRAM),$(eval $(call create_program_targets,$(notdir $(target)),$(target))))
# The dependency files which will be automatically generated by gcc.
# The filter is due to that libraries also appear in OBJ
DEP := $(filter %.d,$(OBJ:%.o=%.d))
# If the goal is a relative path to a file, convert it to an absolute path
ifneq ($(filter-out $(COMMANDS),$(MAKECMDGOALS)),)
ABSGOAL := $(abspath $(MAKECMDGOALS))
ifneq ($(MAKECMDGOALS),$(ABSGOAL))
$(MAKECMDGOALS): $(ABSGOAL) ;
endif
endif
##########
# PROGRAMS
##########
$(PROGRAM): $(OBJ)
$(BIN_CXX) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
# Primary build targets
all: $(LIB_TARGETS)
##########
# CLEANING
##########
clean: $(SUBDIRS)
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB) $(LIB_SHARED) $(PROGRAM)
ifdef PRECOMPILED_HEADER_NAME
$(BIN_RM) -f $(PRECOMPILED_HEADER_NAME).gch
endif
mostlyclean: $(SUBDIRS)
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB) $(LIB_SHARED) $(PROGRAM)
clean:
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS)
distclean: clean
$(BIN_RM) -rf $(DISTCLEANFILES) $(DEP)
ifdef PRECOMPILED_HEADER_NAME
$(BIN_RM) -f $(PRECOMPILED_HEADER_NAME).gch
endif
depclean: clean
$(BIN_RM) -rf $(DEP)
#########
# INSTALL
#########
ifeq (install, $(MAKECMDGOALS))
INSTALL_LIB=$(addprefix $(P_LIB)/, $(LIB_SHARED) $(LIB_SHARED_FULL))
endif
install:
BIN_SINSTALL=$(BIN_INSTALL)
install: $(SUBDIRS) install-share install-program install-lib
install-strip:
$(MAKE) BIN_SINSTALL='$(BIN_INSTALL) -s' install
install-program:
ifdef PROGRAM_INSTALL
@$(BIN_MKDIR) -p $(DESTDIR)$(P_BINDIR)
@$(BIN_SINSTALL) $(PROGRAM) $(DESTDIR)$(P_BINDIR)/$(PROGRAM)
endif
install-lib:
ifdef LIB_SHARED_INSTALL
$(BIN_MKDIR) -p $(DESTDIR)$(P_LIB)
$(BIN_SINSTALL) $(LIB_SHARED_FULL) $(DESTDIR)$(P_LIB)/$(LIB_SHARED_FULL)
$(BIN_LN) -sf $(LIB_SHARED_FULL) $(DESTDIR)$(P_LIB)/$(LIB_SHARED)
endif
install-share:
ifdef DATA_SHARE
@$(BIN_MKDIR) -p $(addprefix $(DESTDIR)$(P_DATA)/, $(dir $(DATA_SHARE)))
@for i in $(DATA_SHARE); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(DESTDIR)$(P_DATA)/$$i"; \
$(BIN_INSTALL) $$i $(DESTDIR)$(P_DATA)/$$i; \
done
endif
ifdef DATA_SHARE_DOC
@$(BIN_MKDIR) -p $(addprefix $(DESTDIR)$(P_DOC)/, $(dir $(DATA_SHARE_DOC)))
@for i in $(DATA_SHARE_DOC); do \
$(BIN_ECHO) "$(BIN_INSTALL) $$i $(DESTDIR)$(P_DOC)/$$i"; \
$(BIN_INSTALL) $$i $(DESTDIR)$(P_DOC)/$$i; \
done
endif
########################
# SUBDIRECTORY TRAVERSAL
########################
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
# Set relations to ensure dependencies are built before their targets during parallel builds.
automation: libaegisub vendor/luajit
src: vendor/universalchardet vendor/luajit tools libaegisub
tests: libaegisub
tools: libaegisub
$(OBJ): $(GLOBAL_DEPS)
OBJCXXFLAGS := $(CXXFLAGS)
####################
# PRECOMPILED HEADER
####################
ifdef PRECOMPILED_HEADER_NAME
ifeq (yes, $(PRECOMPILED_HEADER))
CXXFLAGS += -include $(PRECOMPILED_HEADER_NAME) $(PCHFLAGS)
# This hack is required until we can use the 'private' keyword (gmake 3.82) to avoid all the
# per-object CXXFLAGS being triggered by the ($OBJ) line.
CXXFLAGS_GNU_MAKE_SUCKS := $(CXXFLAGS)
$(OBJ): | $(PRECOMPILED_HEADER_NAME).gch
$(PRECOMPILED_HEADER_NAME).gch: CXXFLAGS = $(CXXFLAGS_GNU_MAKE_SUCKS)
$(PRECOMPILED_HEADER_NAME).gch: $(PRECOMPILED_HEADER_NAME)
else
CXXFLAGS += -include acconf.h
endif
endif
########
# CCACHE
########
ifeq (yes, $(CCACHE_ENABLE))
CXX_ENV = $(CCACHE_ENV)
BIN_CC := ccache $(BIN_CC)
BIN_CXX := ccache $(BIN_CXX)
endif
##################
# TRANSFORM RULES
##################
# The actual build rules
.SUFFIXES:
.SUFFIXES: .o .c .cpp .cxx .mm
%.o: %.c
$(CXX_ENV) $(BIN_CC) $(CFLAGS_DEP) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
CXX_CMD = $(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS)
CC_CMD = $(CXX_ENV) $(BIN_CC) $(CFLAGS_DEP) $(CPPFLAGS)
POST_FLAGS = $($@_FLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o: %.c ; $(CC_CMD) $(CFLAGS) $(POST_FLAGS)
%.o: %.cpp ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
%.o: %.cxx ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
%.o: %.cc ; $(CXX_CMD) $(CXXFLAGS) $(POST_FLAGS)
%.o: %.mm ; $(CXX_CMD) $(OBJCXXFLAGS) $(POST_FLAGS)
%.o: %.m ; $(CC_CMD) $(CFLAGS) -fmodules $(POST_FLAGS)
%.o: %.cxx
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o: %.cc
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o: %.mm
$(CXX_ENV) $(BIN_CXX) $(CFLAGS_DEP) $(CPPFLAGS) $(OBJCXXFLAGS) -c -o $@ $<
$(PRECOMPILED_HEADER_NAME).gch: $(PRECOMPILED_HEADER_NAME)
%.gch: %
@$(BIN_RM) -f $@
$(CXX_ENV) $(BIN_CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header $<
.SECONDEXPANSION:
-include ($DEP)
.SUFFIXES:
# Libraries contain all object files they depend on (but they may depend on other files)
# Not using libtool on OS X because it has an unsilenceable warning about a
# compatibility issue with BSD 4.3 (wtf)
lib%.a: $$($$*_OBJ)
@$(BIN_MKDIR_P) $(dir $@)
$(BIN_AR) cru $@ $(filter %.o,$^)
$(BIN_RANLIB) $@
-include $(DEP)
endif

View file

@ -1,56 +1,28 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
PRECOMPILED_HEADER_NAME = ../libaegisub/lagi_pre.h
DATA_AUTOMATION := \
$(wildcard $(d)autoload/*) \
$(wildcard $(d)demos/*) \
$(wildcard $(d)include/*.lua) \
$(wildcard $(d)include/aegisub/*)
PROGRAM = aegisub-lua
DATA_AUTOMATION_REL := $(subst $(d),,$(DATA_AUTOMATION))
DATA_AUTOMATION_INSTALLED = $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(DATA_AUTOMATION_REL))
CXXFLAGS += -I../libaegisub/include -I../src -I.. $(CXXFLAGS_WX)
CPPFLAGS += $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
$(DESTDIR)$(P_DATA)/automation/%: $(d)%
$(MKDIR_INSTALL)
LIBS := -L../libaegisub -laegisub $(LIBS_LUA) $(LIBS)
LIBS += ../vendor/luabins/libluabins.a
LIBS += $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU)
aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a $(LIBS_LUA)
aegisub-lua_CPPFLAGS := $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(TOP)libaegisub/include -I$(TOP)src $(CXXFLAGS_WX)
aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU)
SRC += tests/aegisub.cpp
PROGRAM += $(d)aegisub-lua
test: $(PROGRAM)
LUA=./aegisub-lua busted -p 'moon' tests/modules
test-automation: $(PROGRAM)
cd $(TOP)automation; LUA=./aegisub-lua busted -p 'moon' tests/modules
.PHONY: test
test: test-automation
# share/
DATA_AUTOMATION += \
autoload/cleantags-autoload.lua \
autoload/kara-templater.lua \
autoload/karaoke-auto-leadin.lua \
autoload/macro-1-edgeblur.lua \
autoload/macro-2-mkfullwitdh.lua \
autoload/select-overlaps.moon \
autoload/strip-tags.lua \
demos/future-windy-blur.lua \
demos/raytracer.lua \
include/aegisub/clipboard.lua \
include/aegisub/re.moon \
include/aegisub/unicode.moon \
include/aegisub/util.moon \
include/cleantags.lua \
include/clipboard.lua \
include/karaskel-auto4.lua \
include/karaskel.lua \
include/moonscript.lua \
include/re.lua \
include/unicode.lua \
include/utils-auto4.lua \
include/utils.lua
install: $(DATA_AUTOMATION_INSTALLED)
all: ;
install: install-share
@$(BIN_MKDIR) -p $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(dir $(DATA_AUTOMATION)))
@for i in $(DATA_AUTOMATION); do \
$(BIN_ECHO) "$(BIN_INSTALL) -m644 $$i $(DESTDIR)$(P_DATA)/automation/$$i"; \
$(BIN_INSTALL) -m644 $$i $(DESTDIR)$(P_DATA)/automation/$$i; \
done
include ../Makefile.target
-include tests/*.d
include $(TOP)Makefile.target

View file

@ -13,7 +13,6 @@ m4_define([hunspell_required_version], [1.2.0])
m4_define([icu_required_version], [4.8.1.1])
m4_define([libass_required_version], [0.9.7])
m4_define([libpulse_required_version], [0.5])
m4_define([lua_auto4_required_version], [5.1])
m4_define([pkgconfig_required_version], [0.20])
m4_define([portaudio_required_version], [19])
m4_define([wx_required_version], [3.0.0])
@ -34,22 +33,15 @@ AC_CANONICAL_HOST
###########################
build_darwin="no"
build_linux="no"
build_bsd="no"
build_default="no"
AS_CASE([$host],
[*-*-darwin*], [build_darwin="yes"],
[*-*-linux*], [build_linux="yes"],
[*-*-*bsd*], [build_bsd="yes"],
[build_default="yes"])
[*-*-linux*], [build_linux="yes"])
# Used for universalchardet.
AC_AGI_MDCPUCFG($host)
AC_SUBST(build_bsd)
AC_SUBST(build_linux)
AC_SUBST(build_darwin)
AC_SUBST(build_default)
########################
# Configurable variables
@ -431,10 +423,7 @@ AS_IF([test x$with_agi_cv_wxstc = xno], AC_MSG_FAILURE([wxWidgets StyledTextCtrl
# This turns on some internal (to aegisub) debugging features.
# A debug version of wxWidgets is required.
AS_IF([test x$enable_debug = xyes],
[PACKAGE_DEBUG="-debug"
AS_IF([$WX_CONFIG_PATH --debug],[AC_CXX_FLAG([-D_DEBUG])])])
AC_SUBST(PACKAGE_DEBUG)
[AS_IF([$WX_CONFIG_PATH --debug],[AC_CXX_FLAG([-D_DEBUG])])])
############################
# Precompiled Header Support

44
header.mk Normal file
View file

@ -0,0 +1,44 @@
d := $(abspath $(dir $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))))/
ifndef TOP
TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/
include $(TOP)Makefile.inc
subdirs := \
automation \
libaegisub \
packages/desktop \
po \
src \
tests \
tools \
vendor/luabins \
vendor/luajit \
vendor/universalchardet
subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
INCLUDING_CHILD_MAKEFILES=yes
d_save := $d
$(foreach dir,$(filter-out $(abspath $(MAKEFILE_LIST)),$(subdirs)), $(eval include $(dir)))
d := $(d_save)
INCLUDING_CHILD_MAKEFILES=no
DISTCLEANFILES += \
$(TOP)acconf.h \
$(TOP)configure \
$(TOP)acconf.h.in~ \
$(TOP)build/git_version.h \
$(TOP)Makefile.inc \
$(TOP)config.log \
$(TOP)acconf.h.in \
$(TOP)config.status \
$(TOP)autom4te.cache \
$(TOP)aclocal.m4 \
define MKDIR_INSTALL
@$(BIN_MKDIR_P) $(dir $@)
$(BIN_INSTALL) -m644 $< $@
endef
endif

View file

@ -1,67 +1,51 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
LIB = libaegisub.a
CXXFLAGS += -Iinclude -I../src -I.. -fPIC
CPPFLAGS += $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
PRECOMPILED_HEADER_NAME = lagi_pre.h
lagi_pre.h.gch: CXXFLAGS := $(CXXFLAGS)
common/charset_conv.o: CXXFLAGS += $(CFLAGS_ICONV)
common/parser.o: CXXFLAGS += -ftemplate-depth=256
unix/path.o: CXXFLAGS += -DP_DATA=\"$(P_DATA)\"
SRC += \
common/parser.cpp \
ass/dialogue_parser.cpp \
common/cajun/elements.cpp \
common/cajun/reader.cpp \
common/cajun/writer.cpp \
common/calltip_provider.cpp \
common/character_count.cpp \
common/charset.cpp \
common/charset_6937.cpp \
common/charset_conv.cpp \
common/color.cpp \
common/file_mapping.cpp \
common/format.cpp \
common/fs.cpp \
common/hotkey.cpp \
common/io.cpp \
common/json.cpp \
common/kana_table.cpp \
common/karaoke_matcher.cpp \
common/keyframe.cpp \
common/log.cpp \
common/mru.cpp \
common/option.cpp \
common/option_visit.cpp \
common/path.cpp \
common/thesaurus.cpp \
common/util.cpp \
common/vfr.cpp \
common/ycbcr_conv.cpp \
lua/modules.cpp \
lua/modules/lfs.cpp \
lua/modules/lpeg.c \
lua/modules/re.cpp \
lua/modules/unicode.cpp \
lua/script_reader.cpp \
lua/utils.cpp \
unix/access.cpp \
unix/fs.cpp \
unix/log.cpp \
unix/path.cpp \
unix/util.cpp
aegisub_OBJ := \
$(d)common/parser.o \
$(d)ass/dialogue_parser.o \
$(subst .cpp,.o,$(wildcard $(d)common/cajun/*.cpp)) \
$(subst .cpp,.o,$(wildcard $(d)lua/modules/*.cpp)) \
$(subst .c,.o,$(wildcard $(d)lua/modules/*.c)) \
$(subst .cpp,.o,$(wildcard $(d)lua/*.cpp)) \
$(subst .cpp,.o,$(wildcard $(d)unix/*.cpp)) \
$(d)common/calltip_provider.o \
$(d)common/character_count.o \
$(d)common/charset.o \
$(d)common/charset_6937.o \
$(d)common/charset_conv.o \
$(d)common/color.o \
$(d)common/file_mapping.o \
$(d)common/format.o \
$(d)common/fs.o \
$(d)common/hotkey.o \
$(d)common/io.o \
$(d)common/json.o \
$(d)common/kana_table.o \
$(d)common/karaoke_matcher.o \
$(d)common/keyframe.o \
$(d)common/log.o \
$(d)common/mru.o \
$(d)common/option.o \
$(d)common/option_visit.o \
$(d)common/path.o \
$(d)common/thesaurus.o \
$(d)common/util.o \
$(d)common/vfr.o \
$(d)common/ycbcr_conv.o
ifeq (yes, $(BUILD_DARWIN))
SRC += osx/util.mm osx/dispatch.mm osx/spellchecker.mm
aegisub_OBJ += $(subst .mm,.o,$(wildcard $(d)osx/*.mm))
else
SRC += common/dispatch.cpp
aegisub_OBJ += $(d)common/dispatch.o
endif
include ../Makefile.target
-include */*.d
-include lua/*/*.d
-include common/*/*.d
aegisub_PCH := $(d)lagi_pre.h
aegisub_CPPFLAGS := -I$(d)include -I$(TOP) -fPIC $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
$(d)common/charset_conv.o_FLAGS := $(CFLAGS_ICONV)
$(d)common/parser.o_FLAGS := -ftemplate-depth=256
$(d)unix/path.o_FLAGS := -DP_DATA=\"$(P_DATA)\"
LIB += aegisub
include $(TOP)Makefile.target

View file

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 895 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -1,47 +1,26 @@
include ../../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk
DESKTOP_SRC := $(d)
applicationsdir = $(DESKTOP_DATADIR)/applications
applications_DATA = aegisub.desktop
ICONS = $(wildcard $(d)*.png) $(wildcard $(d)*.svg)
ICONS_INSTALLED = $(DESTDIR)$(P_ICON)/hicolor/%/aegisub.
iconsscalabledir = $(DESKTOP_DATADIR)/icons/hicolor/scalable/apps
iconsscalable_DATA = scalable/aegisub.svg
DESKTOP_FILE := $(d)aegisub.desktop
DESKTOP_FILE_PO := $(d)../../po
DESKTOP_FILE_INSTALLED = $(DESTDIR)$(P_DESKTOP)/$(notdir $(DESKTOP_FILE))
aegisub.desktop: aegisub.desktop.template ../../po
intltool-merge --quiet --desktop-style ../../po aegisub.desktop.template aegisub.desktop
DISTCLEANFILES += $(DESKTOP_FILE)
all: ;
%.desktop: %.desktop.template $(DESKTOP_FILE_PO)
intltool-merge --quiet --desktop-style $(DESKTOP_FILE_PO) $< $@
ICON_HICOLOR = \
16x16/apps/aegisub.png \
22x22/apps/aegisub.png \
24x24/apps/aegisub.png \
32x32/apps/aegisub.png \
48x48/apps/aegisub.png \
64x64/apps/aegisub.png
$(ICONS_INSTALLED)png: $(d)%.png ; $(MKDIR_INSTALL)
$(ICONS_INSTALLED)svg: $(d)%.svg ; $(MKDIR_INSTALL)
$(DESKTOP_FILE_INSTALLED): $(DESKTOP_FILE) ; $(MKDIR_INSTALL)
ICON_SCALABLE = \
scalable/apps/aegisub.svg
ifneq (yes, $(BUILD_DARWIN))
install: \
$(DESKTOP_FILE_INSTALLED) \
$(patsubst %.png, $(ICONS_INSTALLED)png, $(patsubst %.svg, $(ICONS_INSTALLED)svg, $(notdir $(ICONS))))
endif
DESKTOP_FILE = aegisub.desktop
install: install-desktop install-icons
install-desktop: $(DESKTOP_FILE)
@$(BIN_MKDIR) -p $(DESTDIR)$(P_DESKTOP)
$(BIN_INSTALL) $(DESKTOP_FILE) $(DESTDIR)$(P_DESKTOP)/$(DESKTOP_FILE)
install-icons:
@$(BIN_MKDIR) -p $(addprefix $(DESTDIR)$(P_ICON)/hicolor/, $(dir $(ICON_HICOLOR)))
@for i in $(ICON_HICOLOR); do \
$(BIN_ECHO) "$(BIN_INSTALL) -m644 $$i $(DESTDIR)$(P_ICON)/hicolor/$$i"; \
$(BIN_INSTALL) -m644 $$i $(DESTDIR)$(P_ICON)/hicolor/$$i; \
done
$(BIN_TOUCH) $(DESTDIR)$(P_ICON)/hicolor
$(BIN_MKDIR) -p $(DESTDIR)$(P_ICON)/hicolor/scalable/apps
$(BIN_CP) $(ICON_SCALABLE) $(DESTDIR)$(P_ICON)/hicolor/$(ICON_SCALABLE)
DISTCLEANFILES = aegisub.desktop
include ../../Makefile.target
include $(TOP)Makefile.target

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,52 +1,24 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
.SUFFIXES: .po .mo
PO = \
ar.po \
bg.po \
ca.po \
cs.po \
da.po \
de.po \
el.po \
es.po \
eu.po \
fa.po \
fi.po \
fr_FR.po \
gl.po \
hu.po \
id.po \
it.po \
ja.po \
ko.po \
nl.po \
pl.po \
pt_BR.po \
pt_PT.po \
ru.po \
sr_RS.po \
sr_RS@latin.po \
vi.po \
zh_CN.po \
zh_TW.po
PO := $(wildcard $(d)*.po)
MO := $(PO:po=mo)
MO = $(addsuffix .mo, $(basename $(PO)))
all: $(MO)
ifeq (yes, $(BUILD_DARWIN))
MO_INSTALLED = $(DESTDIR)$(P_LOCALE)/%.lproj/$(AEGISUB_CATALOG).mo
else
MO_INSTALLED = $(DESTDIR)$(P_LOCALE)/%/LC_MESSAGES/$(AEGISUB_CATALOG).mo
endif
%.mo: %.po
$(BIN_MSGFMT) -o $@ $<
install:
@$(BIN_MKDIR) -p $(addsuffix /LC_MESSAGES/, $(addprefix $(DESTDIR)$(P_LOCALE)/, $(basename $(PO))))
@for i in $(basename $(PO)); do \
$(BIN_ECHO) "$(BIN_INSTALL) -m644 $$i.mo $(DESTDIR)$(P_LOCALE)/$$i/LC_MESSAGES/$(AEGISUB_CATALOG).mo"; \
$(BIN_INSTALL) -m644 $$i.mo $(DESTDIR)$(P_LOCALE)/$$i/LC_MESSAGES/$(AEGISUB_CATALOG).mo; \
done
$(MO_INSTALLED): $(d)%.mo ; $(MKDIR_INSTALL)
all: $(MO)
install: $(patsubst %.mo, $(MO_INSTALLED), $(notdir $(MO)))
CLEANFILES = $(MO)
CLEANFILES += $(MO)
include ../Makefile.target
include $(TOP)Makefile.target

View file

@ -1,271 +1,207 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
PROGRAM = $(AEGISUB_COMMAND)
PROGRAM_INSTALL = yes
PROGRAM += $(d)src
PRECOMPILED_HEADER_NAME=agi_pre.h
src_CPPFLAGS := -I$(d) -I.. -I$(d)include -I$(TOP)libaegisub/include -I$(TOP)build \
$(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_ICU)
src_CXXFLAGS := -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)
src_LIBS := $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE) \
$(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) $(LIBS_ICU)
src_PCH := $(d)agi_pre.h
src_INSTALLNAME := $(AEGISUB_COMMAND)
AEGISUB_CFLAGS = -I. -I.. -Iinclude -I../libaegisub/include -I../build -DAEGISUB $(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_ICU)
CFLAGS += $(AEGISUB_CFLAGS)
CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)
LIBS := -L../libaegisub -laegisub $(LIBS_LUA) $(LIBS)
LIBS += $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE)
LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_UCHARDET) $(LIBS_BOOST)
LIBS += $(LIBS_ICU) ../vendor/luabins/libluabins.a
src_OBJ := \
$(subst .cpp,.o,$(wildcard $(d)command/*.cpp)) \
$(subst .cpp,.o,$(wildcard $(d)dialog_*.cpp)) \
$(subst .cpp,.o,$(wildcard $(d)subtitle_format*.cpp)) \
$(subst .cpp,.o,$(wildcard $(d)visual_tool*.cpp)) \
$(d)MatroskaParser.o \
$(d)aegisublocale.o \
$(d)ass_attachment.o \
$(d)ass_dialogue.o \
$(d)ass_entry.o \
$(d)ass_export_filter.o \
$(d)ass_exporter.o \
$(d)ass_file.o \
$(d)ass_karaoke.o \
$(d)ass_override.o \
$(d)ass_parser.o \
$(d)ass_style.o \
$(d)ass_style_storage.o \
$(d)ass_time.o \
$(d)async_video_provider.o \
$(d)audio_box.o \
$(d)audio_colorscheme.o \
$(d)audio_controller.o \
$(d)audio_display.o \
$(d)audio_karaoke.o \
$(d)audio_marker.o \
$(d)audio_player.o \
$(d)audio_provider.o \
$(d)audio_provider_convert.o \
$(d)audio_provider_dummy.o \
$(d)audio_provider_hd.o \
$(d)audio_provider_lock.o \
$(d)audio_provider_pcm.o \
$(d)audio_provider_ram.o \
$(d)audio_renderer.o \
$(d)audio_renderer_spectrum.o \
$(d)audio_renderer_waveform.o \
$(d)audio_timing_dialogue.o \
$(d)audio_timing_karaoke.o \
$(d)auto4_base.o \
$(d)auto4_lua.o \
$(d)auto4_lua_assfile.o \
$(d)auto4_lua_dialog.o \
$(d)auto4_lua_progresssink.o \
$(d)avisynth_wrap.o \
$(d)base_grid.o \
$(d)charset_detect.o \
$(d)colorspace.o \
$(d)colour_button.o \
$(d)compat.o \
$(d)context.o \
$(d)crash_writer.o \
$(d)export_fixstyle.o \
$(d)export_framerate.o \
$(d)fft.o \
$(d)font_file_lister.o \
$(d)font_file_lister_fontconfig.o \
$(d)frame_main.o \
$(d)gl_text.o \
$(d)gl_wrap.o \
$(d)grid_column.o \
$(d)help_button.o \
$(d)hotkey.o \
$(d)hotkey_data_view_model.o \
$(d)initial_line_state.o \
$(d)main.o \
$(d)menu.o \
$(d)mkv_wrap.o \
$(d)pen.o \
$(d)persist_location.o \
$(d)preferences.o \
$(d)preferences_base.o \
$(d)project.o \
$(d)resolution_resampler.o \
$(d)search_replace_engine.o \
$(d)selection_controller.o \
$(d)spellchecker.o \
$(d)spline.o \
$(d)spline_curve.o \
$(d)string_codec.o \
$(d)subs_controller.o \
$(d)subs_edit_box.o \
$(d)subs_edit_ctrl.o \
$(d)subs_preview.o \
$(d)subtitles_provider.o \
$(d)subtitles_provider_libass.o \
$(d)text_file_reader.o \
$(d)text_file_writer.o \
$(d)text_selection_controller.o \
$(d)thesaurus.o \
$(d)timeedit_ctrl.o \
$(d)toggle_bitmap.o \
$(d)toolbar.o \
$(d)tooltip_manager.o \
$(d)utils.o \
$(d)validators.o \
$(d)vector2d.o \
$(d)version.o \
$(d)video_box.o \
$(d)video_controller.o \
$(d)video_display.o \
$(d)video_frame.o \
$(d)video_out_gl.o \
$(d)video_provider_cache.o \
$(d)video_provider_dummy.o \
$(d)video_provider_manager.o \
$(d)video_provider_yuv4mpeg.o \
$(d)video_slider.o \
$(d)visual_feature.o \
$(LIBS_LUA) \
$(TOP)lib/libaegisub.a \
$(TOP)lib/libluabins.a \
$(TOP)lib/libresrc.a \
$(TOP)lib/libuniversalchardet.a \
ifeq (yes, $(BUILD_DARWIN))
SRC += osx/osx_utils.mm osx/retina_helper.mm osx/scintilla_ime.mm
src_OBJ += $(subst .mm,.o,$(wildcard $(d)osx/*.mm))
endif
lpeg.o: CXXFLAGS += -Wno-unused-function
MatroskaParser.o: CFLAGS += -Wno-sometimes-uninitialized
###############
# AUDIO PLAYERS
###############
$(d)audio_player_alsa.o_FLAGS := $(CFLAGS_ALSA)
$(d)audio_player_portaudio.o_FLAGS := $(CFLAGS_PORTAUDIO)
$(d)audio_player_pulse.o_FLAGS := $(CFLAGS_LIBPULSE)
$(d)audio_player_openal.o_FLAGS := $(CFLAGS_OPENAL)
$(d)audio_player_oss.o_FLAGS := $(CFLAGS_OSS)
ifeq (yes, $(HAVE_ALSA))
audio_player_alsa.o: CXXFLAGS += $(CFLAGS_ALSA)
LIBS += $(LIBS_ALSA)
SRC += audio_player_alsa.cpp
src_LIBS += $(LIBS_ALSA)
src_OBJ += $(d)audio_player_alsa.o
endif
ifeq (yes, $(HAVE_PORTAUDIO))
audio_player_portaudio.o: CXXFLAGS += $(CFLAGS_PORTAUDIO)
LIBS += $(LIBS_PORTAUDIO)
SRC += audio_player_portaudio.cpp
src_LIBS += $(LIBS_PORTAUDIO)
src_OBJ += $(d)audio_player_portaudio.o
endif
ifeq (yes, $(HAVE_LIBPULSE))
audio_player_pulse.o: CXXFLAGS += $(CFLAGS_LIBPULSE)
LIBS += $(LIBS_LIBPULSE)
SRC += audio_player_pulse.cpp
src_LIBS += $(LIBS_LIBPULSE)
src_OBJ += $(d)audio_player_pulse.o
endif
ifeq (yes, $(HAVE_OPENAL))
audio_player_openal.o: CXXFLAGS += $(CFLAGS_OPENAL)
LIBS += $(LIBS_OPENAL)
SRC += audio_player_openal.cpp
src_LIBS += $(LIBS_OPENAL)
src_OBJ += $(d)audio_player_openal.o
endif
ifeq (yes, $(HAVE_OSS))
audio_player_oss.o: CXXFLAGS += $(CFLAGS_OSS)
SRC += audio_player_oss.cpp
src_OBJ += $(d)audio_player_oss.o
endif
#######################
# AUDIO / VIDEO SUPPORT
#######################
ifeq (yes, $(HAVE_FFMS2))
audio_provider_ffmpegsource.o video_provider_ffmpegsource.o ffmpegsource_common.o preferences.o: \
CXXFLAGS += $(CFLAGS_FFMS2)
LIBS += $(LIBS_FFMS2)
SRC += audio_provider_ffmpegsource.cpp video_provider_ffmpegsource.cpp ffmpegsource_common.cpp
$(d)audio_provider_ffmpegsource.o_FLAGS := $(CFLAGS_FFMS2)
$(d)video_provider_ffmpegsource.o_FLAGS := $(CFLAGS_FFMS2)
$(d)ffmpegsource_common.o_FLAGS := $(CFLAGS_FFMS2)
$(d)preferences.o_FLAGS := $(CFLAGS_FFMS2)
src_LIBS += $(LIBS_FFMS2)
src_OBJ += \
$(d)audio_provider_ffmpegsource.o \
$(d)video_provider_ffmpegsource.o \
$(d)ffmpegsource_common.o
endif
###########
# SUBTITLES
###########
subtitles_provider_libass.o: CXXFLAGS += $(CFLAGS_LIBASS) -Wno-c++11-narrowing
subtitles_provider.o: CXXFLAGS += $(CFLAGS_LIBASS)
LIBS += $(LIBS_LIBASS)
SRC += subtitles_provider_libass.cpp
##############
# MISCELLANOUS
##############
ifeq (yes, $(HAVE_HUNSPELL))
spellchecker_hunspell.o: CXXFLAGS += $(CFLAGS_HUNSPELL)
LIBS += $(LIBS_HUNSPELL)
SRC += spellchecker_hunspell.cpp
$(d)spellchecker_hunspell.o_FLAGS := $(CFLAGS_HUNSPELL)
src_LIBS += $(LIBS_HUNSPELL)
src_OBJ += $(d)spellchecker_hunspell.o
endif
#####################
# SOURCE-LEVEL CFLAGS
#####################
audio_player.o: CXXFLAGS += $(CFLAGS_ALSA) $(CFLAGS_PORTAUDIO) $(CFLAGS_LIBPULSE) $(CFLAGS_OPENAL)
audio_provider.o: CXXFLAGS += $(CFLAGS_FFMS2)
auto4_base.o: CXXFLAGS += $(CFLAGS_FREETYPE)
charset_detect.o: CXXFLAGS += -D_X86_
font_file_lister_fontconfig.o: CXXFLAGS += $(CFLAGS_FONTCONFIG)
text_file_reader.o: CXXFLAGS += -D_X86_
video_provider_manager.o: CXXFLAGS += $(CFLAGS_FFMS2)
auto4_lua.o auto4_lua_assfile.o auto4_lua_dialog.o auto4_lua_progresssink.o: CPPFLAGS += -I../vendor/luajit/include
$(d)MatroskaParser.o_FLAGS := -Wno-sometimes-uninitialized
$(d)audio_player.o_FLAGS := $(CFLAGS_ALSA) $(CFLAGS_PORTAUDIO) $(CFLAGS_LIBPULSE) $(CFLAGS_OPENAL)
$(d)audio_provider.o_FLAGS := $(CFLAGS_FFMS2)
$(d)auto4_base.o_FLAGS := $(CFLAGS_FREETYPE)
$(d)charset_detect.o_FLAGS := -D_X86_
$(d)font_file_lister_fontconfig.o_FLAGS := $(CFLAGS_FONTCONFIG)
$(d)subtitles_provider.o_FLAGS := $(CFLAGS_LIBASS)
$(d)subtitles_provider_libass.o_FLAGS := $(CFLAGS_LIBASS) -Wno-c++11-narrowing
$(d)text_file_reader.o_FLAGS := -D_X86_
$(d)video_provider_manager.o_FLAGS := $(CFLAGS_FFMS2)
$(d)auto4_lua.o_FLAGS := -I$(TOP)vendor/luajit/include
$(d)auto4_lua_assfile.o_FLAGS := -I$(TOP)vendor/luajit/include
$(d)auto4_lua_dialog.o_FLAGS := -I$(TOP)vendor/luajit/include
$(d)auto4_lua_progresssink.o_FLAGS := -I$(TOP)vendor/luajit/include
SRC += \
MatroskaParser.c \
aegisublocale.cpp \
ass_attachment.cpp \
ass_dialogue.cpp \
ass_entry.cpp \
ass_export_filter.cpp \
ass_exporter.cpp \
ass_file.cpp \
ass_karaoke.cpp \
ass_override.cpp \
ass_parser.cpp \
ass_style.cpp \
ass_style_storage.cpp \
ass_time.cpp \
async_video_provider.cpp \
audio_box.cpp \
audio_colorscheme.cpp \
audio_controller.cpp \
audio_display.cpp \
audio_karaoke.cpp \
audio_marker.cpp \
audio_player.cpp \
audio_provider.cpp \
audio_provider_convert.cpp \
audio_provider_dummy.cpp \
audio_provider_hd.cpp \
audio_provider_lock.cpp \
audio_provider_pcm.cpp \
audio_provider_ram.cpp \
audio_renderer.cpp \
audio_renderer_spectrum.cpp \
audio_renderer_waveform.cpp \
audio_timing_dialogue.cpp \
audio_timing_karaoke.cpp \
auto4_base.cpp \
auto4_lua.cpp \
auto4_lua_assfile.cpp \
auto4_lua_dialog.cpp \
auto4_lua_progresssink.cpp \
avisynth_wrap.cpp \
base_grid.cpp \
charset_detect.cpp \
colorspace.cpp \
colour_button.cpp \
command/app.cpp \
command/audio.cpp \
command/automation.cpp \
command/command.cpp \
command/edit.cpp \
command/grid.cpp \
command/help.cpp \
command/keyframe.cpp \
command/recent.cpp \
command/subtitle.cpp \
command/time.cpp \
command/timecode.cpp \
command/tool.cpp \
command/video.cpp \
command/vis_tool.cpp \
compat.cpp \
context.cpp \
crash_writer.cpp \
dialog_about.cpp \
dialog_attachments.cpp \
dialog_automation.cpp \
dialog_autosave.cpp \
dialog_colorpicker.cpp \
dialog_detached_video.cpp \
dialog_dummy_video.cpp \
dialog_export.cpp \
dialog_export_ebu3264.cpp \
dialog_fonts_collector.cpp \
dialog_jumpto.cpp \
dialog_kara_timing_copy.cpp \
dialog_log.cpp \
dialog_paste_over.cpp \
dialog_progress.cpp \
dialog_properties.cpp \
dialog_resample.cpp \
dialog_search_replace.cpp \
dialog_selected_choices.cpp \
dialog_selection.cpp \
dialog_shift_times.cpp \
dialog_spellchecker.cpp \
dialog_style_editor.cpp \
dialog_style_manager.cpp \
dialog_styling_assistant.cpp \
dialog_text_import.cpp \
dialog_timing_processor.cpp \
dialog_translation.cpp \
dialog_version_check.cpp \
dialog_video_details.cpp \
dialog_video_properties.cpp \
export_fixstyle.cpp \
export_framerate.cpp \
fft.cpp \
font_file_lister.cpp \
font_file_lister_fontconfig.cpp \
frame_main.cpp \
gl_text.cpp \
gl_wrap.cpp \
grid_column.cpp \
help_button.cpp \
hotkey.cpp \
hotkey_data_view_model.cpp \
initial_line_state.cpp \
main.cpp \
menu.cpp \
mkv_wrap.cpp \
pen.cpp \
persist_location.cpp \
preferences.cpp \
preferences_base.cpp \
project.cpp \
resolution_resampler.cpp \
search_replace_engine.cpp \
selection_controller.cpp \
spellchecker.cpp \
spline.cpp \
spline_curve.cpp \
string_codec.cpp \
subs_controller.cpp \
subs_edit_box.cpp \
subs_edit_ctrl.cpp \
subs_preview.cpp \
subtitle_format.cpp \
subtitle_format_ass.cpp \
subtitle_format_ebu3264.cpp \
subtitle_format_encore.cpp \
subtitle_format_microdvd.cpp \
subtitle_format_mkv.cpp \
subtitle_format_srt.cpp \
subtitle_format_ssa.cpp \
subtitle_format_transtation.cpp \
subtitle_format_ttxt.cpp \
subtitle_format_txt.cpp \
subtitles_provider.cpp \
text_file_reader.cpp \
text_file_writer.cpp \
text_selection_controller.cpp \
thesaurus.cpp \
timeedit_ctrl.cpp \
toggle_bitmap.cpp \
toolbar.cpp \
tooltip_manager.cpp \
utils.cpp \
validators.cpp \
vector2d.cpp \
version.cpp \
video_box.cpp \
video_controller.cpp \
video_display.cpp \
video_frame.cpp \
video_out_gl.cpp \
video_provider_cache.cpp \
video_provider_dummy.cpp \
video_provider_manager.cpp \
video_provider_yuv4mpeg.cpp \
video_slider.cpp \
visual_feature.cpp \
visual_tool.cpp \
visual_tool_clip.cpp \
visual_tool_cross.cpp \
visual_tool_drag.cpp \
visual_tool_rotatexy.cpp \
visual_tool_rotatez.cpp \
visual_tool_scale.cpp \
visual_tool_vector_clip.cpp
include libresrc/Makefile.inc
include ../Makefile.target
-include *.d
-include command/*.d
-include libresrc/*.d
include $(d)libresrc/Makefile

View file

@ -23,6 +23,7 @@
#include <memory>
class wxWindow;
namespace agi { namespace charset { class IconvWrapper; } }
#pragma pack(push, 1)

34
src/libresrc/Makefile Normal file
View file

@ -0,0 +1,34 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk
LIB += resrc
resrc_CPPFLAGS := -I$(TOP) -I$(d) $(CPPFLAGS_WX)
resrc_OBJ := \
$(d)bitmap.o \
$(d)default_config.o \
$(d)libresrc.o
$(resrc_OBJ): $(d)default_config.h $(d)bitmap.h
RESPACK := cd $(TOP)src/libresrc; $(TOP)vendor/luajit/src/host/minilua $(TOP)tools/respack.lua
$(d)bitmap.cpp $(d)bitmap.h: $(TOP)tools/respack.lua $(d)../bitmaps/button
$(RESPACK) ../bitmaps/manifest.respack bitmap.cpp bitmap.h
ifeq (yes, $(BUILD_DARWIN))
$(d)default_config.cpp $(d)default_config.h: $(TOP)tools/respack.lua $(d)*.json $(d)osx/*.json
$(RESPACK) manifest_osx.respack default_config.cpp default_config.h
else
$(d)default_config.cpp $(d)default_config.h: $(TOP)tools/respack.lua $(d)*.json
$(RESPACK) manifest.respack default_config.cpp default_config.h
endif
CLEANFILES += \
$(d)bitmap.cpp \
$(d)bitmap.h \
$(d)default_config.cpp \
$(d)default_config.h
DISTCLEANFILES += $(d)default_config_platform.json
include $(TOP)Makefile.target

View file

@ -1,26 +0,0 @@
SRC += \
libresrc/bitmap.cpp \
libresrc/default_config.cpp \
libresrc/libresrc.cpp
libresrc/bitmap.cpp libresrc/bitmap.h: ../tools/respack.lua bitmaps/button/*
../tools/respack.lua bitmaps/manifest.respack libresrc/bitmap.cpp libresrc/bitmap.h
ifeq (yes, $(BUILD_DARWIN))
libresrc/default_config.cpp libresrc/default_config.h: ../tools/respack.lua libresrc/*.json libresrc/osx/*.json
../tools/respack.lua libresrc/manifest_osx.respack libresrc/default_config.cpp libresrc/default_config.h
else
libresrc/default_config.cpp libresrc/default_config.h: ../tools/respack.lua libresrc/*.json
../tools/respack.lua libresrc/manifest.respack libresrc/default_config.cpp libresrc/default_config.h
endif
CLEANFILES += \
libresrc/bitmap.cpp \
libresrc/bitmap.h \
libresrc/default_config.cpp \
libresrc/default_config.h
DISTCLEANFILES += default_config_platform.json
GLOBAL_DEPS += libresrc/bitmap.h libresrc/default_config.h

View file

@ -12,6 +12,7 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <cstdlib>
#include <utility>
#include "bitmap.h"

View file

@ -44,6 +44,10 @@
#include <wx/menu.h>
#include <wx/menuitem.h>
#ifdef __WXMAC__
#include <wx/app.h>
#endif
namespace {
/// Window ID of first menu item
static const int MENU_ID_BASE = 10000;

View file

@ -38,6 +38,7 @@
#include <libaegisub/line_wrap.h>
#include <boost/algorithm/string/replace.hpp>
#include <wx/utils.h>
namespace
{

View file

@ -1,52 +1,37 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
GTEST_ROOT = ../vendor/googletest
GTEST_ROOT ?= $(TOP)vendor/googletest
GTEST_FILE := ${GTEST_ROOT}/src/gtest-all
PROGRAM = run
run_PCH := $(d)support/tests_pre.h
run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
-I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
run_LIBS := $(LIBS_BOOST) $(LIBS_ICU)
run_OBJ := \
$(subst .cpp,.o,$(wildcard $(d)tests/*.cpp)) \
$(d)support/main.o \
$(d)support/util.o \
$(d)support/util_unix.o \
$(TOP)lib/libaegisub.a \
$(TOP)lib/libuniversalchardet.a \
$(GTEST_FILE).o
LIBS += -L../libaegisub -laegisub -L../vendor/universalchardet -luniversalchardet $(LIBS_BOOST) $(LIBS_ICU)
LDFLAGS += -Wl,-rpath $(CURDIR)/../libaegisub $(LDFLAGS_ICONV)
CPPFLAGS += -I../src/include -I../libaegisub/include $(CFLAGS_ICONV) -I${GTEST_ROOT} -I${GTEST_ROOT}/include -I./support $(CPPFLAGS_BOOST)
CXXFLAGS += -Wno-unused-value -Wno-sign-compare
PRECOMPILED_HEADER_NAME = ../libaegisub/lagi_pre.h
# This bit of goofiness is to make it only try to build the tests if google
# test can be found and silently skip it if not, by using $(wildcard) to check
# for file existence
PROGRAM += $(subst $(GTEST_FILE).cc,$(d)run,$(wildcard $(GTEST_FILE).cc))
ifeq (yes, $(BUILD_DARWIN))
LDFLAGS += -framework ApplicationServices -framework Foundation
run_LIBS += -framework ApplicationServices -framework Foundation
endif
SRC = \
support/main.cpp \
support/util.cpp \
support/util_unix.cpp \
tests/access.cpp \
tests/cajun.cpp \
tests/color.cpp \
tests/dialogue_lexer.cpp \
tests/format.cpp \
tests/fs.cpp \
tests/hotkey.cpp \
tests/iconv.cpp \
tests/ifind.cpp \
tests/karaoke_matcher.cpp \
tests/keyframe.cpp \
tests/line_iterator.cpp \
tests/line_wrap.cpp \
tests/mru.cpp \
tests/option.cpp \
tests/path.cpp \
tests/signals.cpp \
tests/syntax_highlight.cpp \
tests/thesaurus.cpp \
tests/util.cpp \
tests/uuencode.cpp \
tests/vfr.cpp \
tests/word_split.cpp \
${GTEST_ROOT}/src/gtest-all.cc
$(d)data: $(d)setup.sh
cd $(TOP)tests; ./setup.sh
HEADER = support/*.h tests/*.h
test-libaegisub: $(d)run $(d)data
cd $(TOP)tests; ./run
include ../Makefile.target
-include support/*.d
-include tests/*.d
test: $(subst $(GTEST_FILE).cc,test-libaegisub,$(wildcard $(GTEST_FILE).cc))
include $(TOP)Makefile.target

View file

@ -0,0 +1 @@
#include "../../libaegisub/lagi_pre.h"

View file

@ -1,16 +1,17 @@
include ../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../header.mk
osx-bundle-restart-helper_OBJ := $(d)osx-bundle-restart-helper.o
ifeq (yes, $(BUILD_DARWIN))
osx-bundle-restart-helper: osx-bundle-restart-helper.m
$(BIN_CC) -o osx-bundle-restart-helper -fmodules osx-bundle-restart-helper.m
CLEANFILES += osx-bundle-restart-helper
all: osx-bundle-restart-helper
PROGRAM += $(d)osx-bundle-restart-helper
endif
CXXFLAGS += -I../libaegisub/include $(CFLAGS_ICU)
LIBS := -L../libaegisub -laegisub $(LIBS) $(LIBS_BOOST) $(LIBS_ICU)
repack-thes-dict_OBJ := $(d)repack-thes-dict.o $(TOP)lib/libaegisub.a
repack-thes-dict_LIBS := $(LIBS_BOOST) $(LIBS_ICU)
repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU)
repack-thes-dict: repack-thes-dict.cpp
$(BIN_CXX) -o repack-thes-dict repack-thes-dict.cpp $(CXXFLAGS) $(LIBS)
PROGRAM += $(d)repack-thes-dict
include ../Makefile.target
$(TOP)tools/respack.lua: $(TOP)vendor/luajit/src/host/minilua
include $(TOP)Makefile.target

View file

@ -9,10 +9,6 @@ SRCDIR=`pwd`
HOME_DIR=`echo ~`
WX_PREFIX=`${2} --prefix`
if test -z "${CC}"; then
CC="cc"
fi
if ! test -d packages/osx_bundle; then
echo
echo "Make sure you're in the toplevel source directory"
@ -43,6 +39,7 @@ if ! test -f "tools/osx-bundle.sed"; then
exit 1
fi
# used by osx-bundle.sed
find po -name *.po | sed 's/.*\/\(.*\)\.po/ <string>\1<\/string>/; s/RS/YU/' > languages
find ${SKEL_DIR} -type f -not -regex ".*.svn.*"
@ -54,6 +51,15 @@ cat ${SKEL_DIR}/Contents/Info.plist | sed -f tools/osx-bundle.sed > "${PKG_DIR}/
rm languages
echo
echo "---- Installing files ----"
make install \
DESTDIR="${PKG_DIR}/Contents" \
P_DATA="/SharedSupport" \
P_DOC="/SharedSupport/doc" \
P_LOCALE="/Resources" \
P_BINDIR="/MacOS"
echo
echo "---- Copying dictionaries ----"
if test -z "${DICT_DIR}"; then
@ -67,31 +73,15 @@ else
echo " where the *.aff and *.dic files can be found"
fi
echo
echo "---- Copying automation/ files ----"
pushd automation
make install DESTDIR="../${PKG_DIR}/Contents/SharedSupport" P_DATA="" P_DOC="/doc"
popd
echo
echo "---- Copying Aegisub locale files ----"
# Let Aqua know that aegisub supports english. English strings are
# internal so we don't need an aegisub.mo file.
mkdir -vp "${PKG_DIR}/Contents/Resources/en.lproj"
for i in `ls -1 po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do
# The only serbian locale 10.8 has is sr_YU
destname=$(echo ${i} | sed 's/sr_RS/sr_YU/')
if test -f "po/${i}.mo"; then
mkdir -p "${PKG_DIR}/Contents/Resources/${destname}.lproj"
cp -v po/${i}.mo "${PKG_DIR}/Contents/Resources/${destname}.lproj/aegisub.mo"
else
echo "${i}.mo not found!"
exit 1
fi
done
# 10.8 wants sr_YU rather than sr_RS
mv "${PKG_DIR}/Contents/Resources/sr_RS.lproj" "${PKG_DIR}/Contents/Resources/sr_YU.lproj"
mv "${PKG_DIR}/Contents/Resources/sr_RS@latin.lproj" "${PKG_DIR}/Contents/Resources/sr_YU@latin.lproj"
echo
echo "---- Copying WX locale files ----"
@ -111,16 +101,6 @@ for i in `ls -1 po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do
done
echo
echo " ---- Copying binary ----"
cp -v src/${AEGISUB_BIN} "${PKG_DIR}/Contents/MacOS/aegisub"
echo
echo " ---- Build / install restart-helper ----"
cp -v tools/osx-bundle-restart-helper "${PKG_DIR}/Contents/MacOS/restart-helper"
echo
echo "---- Libraries ----"
python tools/osx-fix-libs.py "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?

View file

@ -24,13 +24,14 @@
#include <boost/phoenix/core/argument.hpp>
#include <boost/phoenix/operator/comparison.hpp>
#include <fstream>
#include <sstream>
namespace {
using boost::phoenix::placeholders::_1;
void convert(std::string const& path) {
std::unique_ptr<std::ifstream> idx(agi::io::Open(path + ".idx"));
std::unique_ptr<std::ifstream> dat(agi::io::Open(path + ".dat"));
std::unique_ptr<std::istream> idx(agi::io::Open(path + ".idx"));
std::unique_ptr<std::istream> dat(agi::io::Open(path + ".dat"));
std::ostringstream idx_out_buffer;
agi::io::Save idx_out(path + ".out.idx");

View file

@ -37,8 +37,7 @@ local manifest = try_open(arg[1], 'r')
local out_cpp = try_open(arg[2], 'w')
local out_h = try_open(arg[3], 'w')
local pos = arg[1]:find('/')
local path = pos and arg[1]:sub(1, pos) or ''
local path = arg[1]:match'(.*/).*' or ''
out_cpp:write('#include "libresrc.h"\n')

View file

@ -1,17 +1,8 @@
include ../../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk
LIB = libluabins.a
luabins_OBJ := $(subst .c,.o,$(wildcard $(d)src/*.c))
luabins_CPPFLAGS := $(CFLAGS_LUA)
CPPFLAGS += -I../luajit/include
LIB += luabins
SRC = \
src/fwrite.c \
src/load.c \
src/luabins.c \
src/luainternals.c \
src/save.c \
src/savebuffer.c \
src/write.c
include ../../Makefile.target
-include src/*.d
include $(TOP)Makefile.target

View file

@ -1,32 +0,0 @@
/*
* lualess.h
* Lua-related definitions for lua-less builds (based on Lua manual)
* See copyright notice in luabins.h
*/
#include <stdlib.h>
/*
* lua_Alloc-compatible allocator to use in Lua-less applications
* with lbs_SaveBuffer. Based on sample code from Lua 5.1 manual.
*/
void * lbs_simplealloc(
void * ud,
void * ptr,
size_t osize,
size_t nsize
)
{
(void) ud;
(void) osize; /* not used */
if (nsize == 0)
{
free(ptr);
return NULL;
}
else
{
return realloc(ptr, nsize);
}
}

View file

@ -1,12 +1,15 @@
default all:
$(MAKE) -C src amalg
include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk
clean:
$(MAKE) -C src clean
LUAJIT_DIR := $(abspath $(d)src)
distclean:
$(MAKE) -C src clean
$(LIBS_LUA): $(LUAJIT_DIR)/host/minilua
$(MAKE) -C $(LUAJIT_DIR) amalg
install:
$(LUAJIT_DIR)/host/minilua:
$(MAKE) -C $(LUAJIT_DIR) host/minilua
.PHONY: all clean install
clean-luajit:
$(MAKE) -C $(LUAJIT_DIR) clean
clean: clean-luajit
distclean: clean-luajit

View file

@ -1,36 +1,8 @@
include ../../Makefile.inc
include $(dir $(lastword $(MAKEFILE_LIST)))../../header.mk
LIB = libuniversalchardet.a
universalchardet_OBJ := $(subst .cpp,.o,$(wildcard $(d)*.cpp))
universalchardet_CPPFLAGS := -D_X86_
CXXFLAGS += -D_X86_
SRC = \
CharDistribution.cpp \
JpCntx.cpp \
LangBulgarianModel.cpp \
LangCyrillicModel.cpp \
LangGreekModel.cpp \
LangHebrewModel.cpp \
LangHungarianModel.cpp \
LangThaiModel.cpp \
nsBig5Prober.cpp \
nsCharSetProber.cpp \
nsEUCJPProber.cpp \
nsEUCKRProber.cpp \
nsEUCTWProber.cpp \
nsEscCharsetProber.cpp \
nsEscSM.cpp \
nsGB2312Prober.cpp \
nsHebrewProber.cpp \
nsLatin1Prober.cpp \
nsMBCSGroupProber.cpp \
nsMBCSSM.cpp \
nsSBCSGroupProber.cpp \
nsSBCharSetProber.cpp \
nsSJISProber.cpp \
nsUTF8Prober.cpp \
nsUniversalDetector.cpp
include ../../Makefile.target
-include *.d
LIB += universalchardet
include $(TOP)Makefile.target