include config.mak

LDFLAGS=`fltk-config --ldflags` -lmlt++ `mlt-config --libs`
CXXFLAGS=-Wall -g -pthread `fltk-config --cxxflags` `mlt-config --cflags`

all:		shotcut-server shotcut-editor shotcut-preview shotcut-inject shotcut-nle

.cpp.o :
	$(CXX) $(CXXFLAGS) -c $<

SERVER_SRC = shotcut-server.cpp
SERVER_OBJ = $(SERVER_SRC:.cpp=.o)

shotcut-server:		$(SERVER_OBJ)
	g++ -o $@ $(SERVER_OBJ) $(LDFLAGS)

PREVIEW_SRC = shotcut-preview.cpp AvPlayer.cpp MiraclePlayer.cpp
PREVIEW_OBJ = $(PREVIEW_SRC:.cpp=.o)

shotcut-preview:	$(PREVIEW_OBJ)
	g++ -o $@ $(PREVIEW_OBJ) $(LDFLAGS)

EDITOR_SRC = shotcut-editor.cpp
EDITOR_OBJ = $(EDITOR_SRC:.cpp=.o)

shotcut-editor:		$(EDITOR_OBJ)
	g++ -o $@ $(EDITOR_OBJ) $(LDFLAGS)

INJECT_SRC = shotcut-inject.cpp
INJECT_OBJ = $(INJECT_SRC:.cpp=.o)

shotcut-inject:		$(INJECT_OBJ)
	g++ -o $@ $(INJECT_OBJ) $(LDFLAGS)

NLE_SRC = shotcut-nle.o AvPlayer.o AvCutter.o AvMultitrack.o AvUtils.o NLE_Server.o NLE_Browser.o NLE_Project.o \
		  NLE_NewProject.o Panel_Comments.o Panel_Attributes.o Panel_Super.o Panel_Obscure.o
NLE_OBJ = $(NLE_SRC:.cpp=.o)

shotcut-nle:		$(NLE_OBJ)
	g++ -o $@ $(NLE_OBJ) $(LDFLAGS)

clean:
	rm -f shotcut-nle shotcut-server shotcut-preview shotcut-editor shotcut-inject *.o

install:
ifeq ($(prefix),)
	@echo "No install available..."
else
	install -d "$(prefix)/bin"
	install -d "$(prefix)/share/shotcut/pixmaps"
	install -c -m 755 shotcut-nle shotcut-templates shotcut-server shotcut-editor shotcut-preview shotcut-inject "$(prefix)/bin"
	install -m 644 pixmaps/logo.png "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_fast_i.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_record.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_fast.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_scene_i.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_movie_i.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_scene.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_movie.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_step_i.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_pause.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_step.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_play_i.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_stop.xpm "$(prefix)/share/shotcut/pixmaps"
	install -m 644 pixmaps/editor_play.xpm "$(prefix)/share/shotcut/pixmaps"
endif

