ocarina/Makefile

42 lines
913 B
Makefile

MAJOR = 5
MINOR = 0
BUG = 0
DEBUG = y
export CC = g++
export INCLUDE = -I$(CURDIR)/include
export GTK = `pkg-config --cflags --libs gtk+-2.0`
export GST = `pkg-config --cflags --libs gstreamer-0.10`
export LINK = $(GST) $(GTK)
export SRCDIR = $(CURDIR)
export MAKEFLAGS = --no-print-directory
DIRS = libsaria gui
CLEANDIRS = $(DIRS:%=clean-%)
ifeq ($(DEBUG), y)
export CFLAGS = -Wall -Werror -g -DDEBUG
else
export CFLAGS = -O2
endif
export BUILD = $(CC) $(CFLAGS) $(INCLUDE)
.PHONY: all $(DIRS) clean $(CLEANDIRS) version.h
all: version.h $(DIRS)
$(BUILD) $(shell find . | grep "\.o$$") -o ocarina $(LINK)
version.h:
sh scripts/make_version.sh $(SRCDIR) $(MAJOR) $(MINOR) $(BUG) $(DEBUG)
$(DIRS):
$(MAKE) -f $(SRCDIR)/scripts/Makefile -C $@
clean: $(CLEANDIRS)
rm -f *.o ocarina include/version.h
$(CLEANDIRS):
$(MAKE) -f $(SRCDIR)/scripts/Makefile -C $(@:clean-%=%) clean