export TOPDIR ?= $(CURDIR)/..
include $(TOPDIR)/global_config
-OBJS = \
+OBJS := \
$(OBJDIR)/aattachmentpoint.o \
$(OBJDIR)/aautomation.o \
$(OBJDIR)/aboutprefs.o \
$(OBJDIR)/audiodvb.o \
$(OBJDIR)/audioesound.o \
$(OBJDIR)/audioidevice.o \
- $(OBJDIR)/audiompeg.o \
$(OBJDIR)/audioodevice.o \
$(OBJDIR)/audiooss.o \
$(OBJDIR)/audiov4l2mpeg.o \
$(OBJDIR)/clipedls.o \
$(OBJDIR)/clippopup.o \
$(OBJDIR)/colorpicker.o \
- $(OBJDIR)/commercials.o \
$(OBJDIR)/commonrender.o \
$(OBJDIR)/confirmquit.o \
$(OBJDIR)/confirmsave.o \
$(OBJDIR)/cwindowgui.o \
$(OBJDIR)/cwindow.o \
$(OBJDIR)/cwindowtool.o \
- $(OBJDIR)/dbwindow.o \
$(OBJDIR)/dcoffset.o \
$(OBJDIR)/deleteallindexes.o \
$(OBJDIR)/device1394input.o \
$(OBJDIR)/device1394output.o \
$(OBJDIR)/devicedvbinput.o \
- $(OBJDIR)/devicempeginput.o \
$(OBJDIR)/devicev4l2base.o \
$(OBJDIR)/devicev4l2input.o \
$(OBJDIR)/dragcheckbox.o \
$(OBJDIR)/drivesync.o \
- $(OBJDIR)/dvbtune.o \
$(OBJDIR)/dvdcreate.o \
$(OBJDIR)/edithandles.o \
$(OBJDIR)/editlength.o \
$(OBJDIR)/exportedl.o \
$(OBJDIR)/fadeengine.o \
$(OBJDIR)/ffmpeg.o \
- $(OBJDIR)/fileac3.o \
$(OBJDIR)/filebaseaudio.o \
$(OBJDIR)/filebase.o \
$(OBJDIR)/filebaseulaw.o \
$(OBJDIR)/filecr2.o \
- $(OBJDIR)/filedb.o \
$(OBJDIR)/filedv.o \
$(OBJDIR)/fileexr.o \
$(OBJDIR)/fileffmpeg.o \
$(OBJDIR)/filegif.o \
$(OBJDIR)/filejpeg.o \
$(OBJDIR)/filelist.o \
- $(OBJDIR)/filempeg.o \
$(OBJDIR)/file.o \
$(OBJDIR)/fileogg.o \
$(OBJDIR)/filepng.o \
$(OBJDIR)/floatauto.o \
$(OBJDIR)/floatautos.o \
$(OBJDIR)/folderlistmenu.o \
+ $(OBJDIR)/forkbase.o \
$(OBJDIR)/formatcheck.o \
$(OBJDIR)/formatpopup.o \
$(OBJDIR)/formatpresets.o \
$(OBJDIR)/maskautos.o \
$(OBJDIR)/maskengine.o \
$(OBJDIR)/mbuttons.o \
- $(OBJDIR)/mediadb.o \
$(OBJDIR)/menuaeffects.o \
$(OBJDIR)/menuattacheffect.o \
$(OBJDIR)/menuattachtransition.o \
$(OBJDIR)/pluginclient.o \
$(OBJDIR)/plugindialog.o \
$(OBJDIR)/pluginfclient.o \
+ $(OBJDIR)/pluginlv2.o \
+ $(OBJDIR)/pluginlv2config.o \
+ $(OBJDIR)/pluginlv2client.o \
+ $(OBJDIR)/pluginlv2gui.o \
$(OBJDIR)/plugin.o \
$(OBJDIR)/pluginpopup.o \
$(OBJDIR)/pluginserver.o \
$(OBJDIR)/vdevice1394.o \
$(OBJDIR)/vdevicebase.o \
$(OBJDIR)/vdevicedvb.o \
- $(OBJDIR)/vdevicempeg.o \
$(OBJDIR)/vdeviceprefs.o \
$(OBJDIR)/vdevicev4l2jpeg.o \
$(OBJDIR)/vdevicev4l2mpeg.o \
$(OBJDIR)/zwindow.o \
$(OBJDIR)/zwindowgui.o \
+ifneq ($(WANT_LIBZMPEG),no)
+OBJS += \
+ $(OBJDIR)/audiompeg.o \
+ $(OBJDIR)/devicempeginput.o \
+ $(OBJDIR)/filempeg.o \
+ $(OBJDIR)/vdevicempeg.o \
+
+endif
+ifneq ($(WANT_COMMERCIAL),no)
+OBJS += \
+ $(OBJDIR)/commercials.o \
+ $(OBJDIR)/dbwindow.o \
+ $(OBJDIR)/filedb.o \
+ $(OBJDIR)/mediadb.o \
+
+endif
+ifneq ($(WANT_CIN_3RDPARTY),no)
+OBJS += \
+ $(OBJDIR)/fileac3.o \
+
+endif
+
+# $(OBJDIR)/dvbtune.o \
# $(OBJDIR)/renderfarmfsclient.o \
# $(OBJDIR)/renderfarmfsserver.o \
LIBRARIES := \
$(GUICAST)/$(OBJDIR)/libguicast.a \
- $(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a \
+
+ifneq ($(WANT_LIBZMPEG),no)
+LIBRARIES += \
$(MPEG2ENC)/$(OBJDIR)/hveg2enc.a \
+ $(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a \
+
+endif
+ifneq ($(WANT_COMMERCIAL),no)
+LIBRARIES += \
$(TDB)/$(OBJDIR)/db.a \
- $(THEME_DATA) \
+
+endif
LIBS := $(LIBRARIES)
+
+ifneq ($(WANT_CIN_3RDPARTY),no)
LIBS += $(libraries)
+else
+
+LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid
+LIBS += -lX11 -lXau -lXdmcp -lXext -lXfixes -lXv -lXinerama
+LIBS += -lfontconfig -lfreetype
+LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
+LIBS += -lswresample -lswscale
+LIBS += -lvpx -lwebp -lwebpmux
+
+LIBS += $(if $(filter fftw,$(static_pkgs)), -lfftw3)
+LIBS += $(if $(filter flac,$(static_pkgs)), -lFLAC)
+LIBS += $(if $(filter giflib,$(static_pkgs)), -lgif)
+LIBS += $(if $(filter lame,$(static_pkgs)), -lmp3lame)
+LIBS += $(if $(filter libjpeg,$(static_pkgs)), -ljpeg)
+LIBS += $(if $(filter openjpeg,$(static_pkgs)), -lopenjp2)
+LIBS += $(if $(filter libogg,$(static_pkgs)), -logg)
+LIBS += $(if $(filter libsndfile,$(static_pkgs)), -lsndfile)
+LIBS += $(if $(filter libtheora,$(static_pkgs)), -ltheoradec -ltheoraenc)
+LIBS += $(if $(filter libuuid,$(static_pkgs)), -luuid)
+LIBS += $(if $(filter libvorbis,$(static_pkgs)), -lvorbis -lvorbisenc -lvorbisfile)
+LIBS += $(if $(filter tiff,$(static_pkgs)), -ltiff)
+LIBS += $(if $(filter twolame,$(static_pkgs)), -ltwolame)
+LIBS += $(if $(filter x264,$(static_pkgs)), -lx264)
+LIBS += $(if $(filter x265,$(static_pkgs)), -lx265)
+LIBS += $(if $(filter libvpx,$(static_pkgs)), -lvpx)
+
+ifneq ($(WANT_GL),no)
+LIBS += -lGL -lGLU -lGLX
+endif
+ifneq ($(WANT_XFT),no)
+LIBS += -lXft
+endif
+ifneq ($(WANT_ALSA),no)
+LIBS += -lasound
+endif
+ifneq ($(WANT_OPENEXR),no)
+LIBS += -lIex -lIexMath -lIlmImf -lIlmImfUtil
+endif
+ifneq ($(WANT_DV),no)
+LIBS += -ldv
+endif
+ifneq ($(WANT_FIREWIRE),no)
+LIBS += -lavc1394 -lraw1394 -liec61883 -lrom1394
+endif
+ifneq ($(WANT_DVB),no)
+LIBS += -ldv
+endif
+ifneq ($(WANT_DL),no)
+LIBS += -ldl
+endif
+ifneq ($(WANT_LIBZMPEG),no)
+LIBS += -lmjpegutils
+endif
+ifneq ($(WANT_OPUS),no)
+LIBS += -lopus
+endif
+ifneq ($(WANT_NUMA),no)
+LIBS += -lnuma
+endif
+ifneq ($(WANT_LV2),no)
+LIBS += -llilv-0 -lsratom-0 -lserd-0 -lsord-0 -lsuil-0
+endif
+endif
+ifneq ($(WANT_COMMERCIAL),no)
CUTADS = $(OBJDIR)/cutads
CUTOBJ = $(OBJDIR)/cutads.o
CUTOBJS = $(CUTOBJ) \
CUTLIBS = \
$(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a -lX11 \
$(TDB)/$(OBJDIR)/db.a
+endif
BDWRITE = $(OBJDIR)/bdwrite
BDWOBJS = $(OBJDIR)/bdwrite.o
+ifneq ($(WANT_LV2),no)
+LV2UI = $(OBJDIR)/lv2ui
+LV2OBJS = \
+ $(OBJDIR)/lv2ui.o \
+ $(OBJDIR)/pluginlv2.o \
+ $(OBJDIR)/pluginlv2ui.o \
+ $(OBJDIR)/pluginlv2config.o \
+ $(OBJDIR)/forkbase.o
+endif
+
CFLAGS := \
-I$(GUICAST) \
-I$(LIBZMPEG3) \
else
-LDFLAGS1 = -export-dynamic
+LDFLAGS1 = -Wl,-export-dynamic -g
LDFLAGS2 =
-LINKER = g++ -o $(OUTPUT)
+LINKER = $(CXX) -o $(OUTPUT)
endif
$(shell mkdir -p $(OBJDIR))
$(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)
-$(shell echo $(LDFLAGS1) $(OBJS) $(DCRAW) $(LIBS) $(LDFLAGS2) > $(OBJDIR)/objs)
+$(shell echo $(LDFLAGS1) $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBS) $(LDFLAGS2) > $(OBJDIR)/objs)
-all: $(OUTPUT) $(CUTADS) $(BDWRITE)
+all: $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
# Static linking is not possible because the plugins depend on symbols
# in the main executable.
# Also VFS only overrides the C library when dynamic linking is used.
-$(OUTPUT): $(OBJS) $(DCRAW) $(FILEEXR) $(FILEFLAC) $(LIBRARIES)
+$(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
$(LINKER) `cat $(OBJDIR)/objs`
$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
ln -f -s ../bin/$(WANT_CIN) ci
+ifneq ($(WANT_COMMERCIAL),no)
$(CUTADS): $(CUTOBJS) $(CUTLIBS) $(LIBRARIES)
@echo g++ -o $@ $(CUTOBJS)
@g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo)
$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
+install-cutads:
+ cp -av $(OBJDIR)/cutads $(BINDIR)/.
+
+install: install-cutads
+endif
+
$(BDWRITE): $(BDWOBJS) $(LIBRARIES)
@echo g++ -o $@ $(BDWOBJS)
@g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
$(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(BDWRITE) $(BDWRITE).debuginfo)
$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
+install-bdwrite:
+ cp -av $(OBJDIR)/bdwrite $(BINDIR)/.
+install: install-bdwrite
+
ydiff: ydiff.C $(LIBRARIES)
@echo g++ -o $@ ydiff.C
@g++ $(CFLAGS) ydiff.C -o $@ $(LIBS)
clean:
rm -rf $(OBJDIR)
-install:
- cp -a $(OBJDIR)/cutads $(BINDIR)/.
- cp -a $(OBJDIR)/bdwrite $(BINDIR)/.
tags:
ctags -R -h default --langmap=c:+.inc . ../guicast/ ../libzmpeg3 ../plugins ../thirdparty/ffmpeg-*
$(OBJDIR)/%.o: %.C
$(CXX) `cat $(OBJDIR)/c_flags` -DMSGQUAL=$* -c $< -o $@
+
$(OBJDIR)/fileexr.o: fileexr.C
$(CXX) `cat $(OBJDIR)/c_flags` -Wno-deprecated -DMSGQUAL=$* -c $< -o $@
$(OBJDIR)/sha1.o: sha1.C sha1.h
$(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@
+#lv2
+ifneq ($(WANT_LV2),no)
+GTK2_INCS := `pkg-config --cflags gtk+-2.0`
+GTK2_LIBS := `pkg-config --libs gtk+-2.0`
+
+$(OBJDIR)/pluginlv2ui.o: pluginlv2ui.C
+$(OBJDIR)/lv2ui.o: lv2ui.C
+$(OBJDIR)/pluginlv2ui.o $(OBJDIR)/lv2ui.o:
+ $(CXX) `cat $(OBJDIR)/c_flags` $(GTK2_INCS) -DMSGQUAL=$* -c $< -o $@
+
+$(OBJDIR)/lv2ui: $(LV2OBJS)
+ @echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
+ @$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
+ $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(LV2UI) $(LV2UI).debuginfo)
+ $(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
+
+.PHONY: lv2ui
+lv2ui: $(LV2UI)
+
+install-lv2ui:
+ cp -av $(LV2UI) $(BINDIR)/.
+
+install: install-lv2ui
+endif
+
+$(OBJDIR)/pluginlv2gui.o: pluginlv2gui.C
+ $(CXX) `cat $(OBJDIR)/c_flags` $(GTK2_INCS) -DMSGQUAL=$* -c $< -o $@
+#dcraw
$(DCRAW): dcraw.C
$(CXX) `cat $(OBJDIR)/c_flags` $(if $(findstring -ggdb,$(CFLAGS)),,-O4) -DNODEPS -DLOCALTIME \
-Wno-misleading-indentation -Wno-sign-compare -Wno-narrowing dcraw.C -c -o $*.o