Use automake

parent 49291497
include config.mk
subdirs = wayland compositor clients spec data
all : subdirs-all
subdirs-all subdirs-clean subdirs-install:
for f in $(subdirs); do $(MAKE) -C $$f $(@:subdirs-%=%); done
install : subdirs-install
clean : subdirs-clean
config.mk : config.mk.in
./config.status
SUBDIRS = wayland compositor clients data
ACLOCAL_AMFLAGS = -I m4
......@@ -9,4 +9,4 @@ cd $srcdir
autoreconf --force -v --install || exit 1
cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@"
$srcdir/configure "$@"
include ../config.mk
CFLAGS += -I../wayland $(CLIENT_CFLAGS)
LDLIBS += -L../wayland -lwayland-client $(CLIENT_LIBS) -lrt -lm
egl_clients = gears
cairo_clients = flower screenshot terminal image view dnd
all : $(egl_clients) $(cairo_clients)
clean :
rm -f $(egl_clients) $(cairo_clients) *.o .*.deps
flower : flower.o window.o wayland-glib.o cairo-util.o
gears : gears.o window.o wayland-glib.o cairo-util.o
screenshot : screenshot.o screenshooter-protocol.o wayland-glib.o cairo-util.o
terminal : terminal.o window.o wayland-glib.o cairo-util.o
image : image.o window.o wayland-glib.o cairo-util.o
view : view.o window.o wayland-glib.o cairo-util.o
dnd : dnd.o window.o wayland-glib.o cairo-util.o
screenshot.c : screenshooter-client-protocol.h
screenshooter-protocol.c : ../compositor/screenshooter.xml
../wayland/scanner code < $< > $@
screenshooter-client-protocol.h : ../compositor/screenshooter.xml
../wayland/scanner client-header < $< > $@
terminal : LDLIBS += -lutil
view : CFLAGS += $(POPPLER_CFLAGS)
view : LDLIBS += $(POPPLER_LIBS)
install :
\ No newline at end of file
noinst_PROGRAMS = gears flower screenshot terminal image view dnd
noinst_LTLIBRARIES = libtoytoolkit.la
INCLUDES = -I$(top_srcdir)/wayland $(CLIENT_CFLAGS) $(POPPLER_CFLAGS)
LDADD = $(top_builddir)/wayland/libwayland-client.la \
libtoytoolkit.la $(CLIENT_LIBS) -lrt -lm
AM_CPPFLAGS = -DDATADIR='"$(datadir)"'
libtoytoolkit_la_SOURCES = \
window.c \
window.h \
wayland-glib.c \
wayland-glib.h \
cairo-util.c \
cairo-util.h
flower_SOURCES = flower.c
gears_SOURCES = gears.c
screenshot_SOURCES = screenshot.c screenshooter-protocol.c
terminal_SOURCES = terminal.c
image_SOURCES = image.c
view_SOURCES = view.c
dnd_SOURCES = dnd.c
BUILT_SOURCES = \
screenshooter-client-protocol.h \
screenshooter-protocol.c
CLEANFILES = $(BUILT_SOURCES)
include $(top_srcdir)/wayland/scanner.mk
terminal_LDADD = $(LDADD) -lutil
view_LDADD = $(LDADD) $(POPPLER_LIBS)
include ../config.mk
CFLAGS += -I../wayland $(COMPOSITOR_CFLAGS)
LDLIBS += -L../wayland -lwayland-server $(COMPOSITOR_LIBS) -rdynamic -lrt -lm
all : compositor
compositor : \
compositor.o \
compositor-drm.o \
compositor-x11.o \
screenshooter.o \
screenshooter-protocol.o \
drm.o \
shm.o
screenshooter.c : screenshooter-server-protocol.h
screenshooter-protocol.c : screenshooter.xml
../wayland/scanner code < $< > $@
screenshooter-server-protocol.h : screenshooter.xml
../wayland/scanner server-header < $< > $@
clean :
rm -f compositor *.o .*.deps
install :
install 70-wayland.rules ${udev_rules_dir}
noinst_PROGRAMS = compositor
INCLUDES = -I$(top_srcdir)/wayland $(COMPOSITOR_CFLAGS)
AM_CPPFLAGS = -DDATADIR='"$(datadir)"'
compositor_LDADD = \
$(top_builddir)/wayland/libwayland-server.la \
$(COMPOSITOR_LIBS)
compositor_SOURCES = \
compositor.c \
compositor.h \
compositor-drm.c \
compositor-x11.c \
screenshooter.c \
screenshooter-protocol.c \
screenshooter-server-protocol.h \
drm.c \
shm.c
BUILT_SOURCES = \
screenshooter-server-protocol.h \
screenshooter-protocol.c
CLEANFILES = $(BUILT_SOURCES)
include $(top_srcdir)/wayland/scanner.mk
CFLAGS = @GCC_CFLAGS@ -O -g -Wall -MMD -MF .$*.deps
CPPFLAGS = -DDATADIR=\"$(datadir)\"
prefix = @prefix@
exec_prefix = @exec_prefix@
udev_rules_dir = @sysconfdir@/udev/rules.d
libdir = @libdir@
includedir = @includedir@
datadir = @datadir@
datarootdir = @datarootdir@
COMPOSITOR_CFLAGS = @COMPOSITOR_CFLAGS@
COMPOSITOR_LIBS = @COMPOSITOR_LIBS@
FFI_CFLAGS = @FFI_CFLAGS@
FFI_LIBS = @FFI_LIBS@
CLIENT_CFLAGS = @CLIENT_CFLAGS@
CLIENT_LIBS = @CLIENT_LIBS@
POPPLER_CFLAGS = @POPPLER_CFLAGS@
POPPLER_LIBS = @POPPLER_LIBS@
EXPAT_LIBS = @EXPAT_LIBS@
first : all
-include .*.deps
AC_INIT(wayland, 0.1)
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AC_PROG_CC
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(FFI, [libffi])
......@@ -25,5 +29,11 @@ AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
AC_SUBST(EXPAT_LIBS)
AC_CONFIG_FILES([config.mk wayland/wayland-server.pc wayland/wayland-client.pc])
AC_CONFIG_FILES([wayland/wayland-server.pc
wayland/wayland-client.pc
Makefile
wayland/Makefile
compositor/Makefile
clients/Makefile
data/Makefile])
AC_OUTPUT
include ../config.mk
waylanddatadir = $(datadir)/wayland
cursor_images = \
dist_waylanddata_DATA = \
bottom_left_corner.png \
bottom_right_corner.png \
bottom_side.png \
......@@ -19,11 +19,3 @@ cursor_images = \
top_right_corner.png \
top_side.png \
xterm.png
all :
clean :
install :
install -d $(datadir)/wayland
install $(cursor_images) $(datadir)/wayland
include ../config.mk
all : main.pdf
main.pdf : main.tex
pdflatex main.tex
clean :
rm -f main.pdf main.aux main.log
install :
include ../config.mk
libs = libwayland-server.so libwayland-client.so
all : $(libs) scanner
headers = \
wayland-util.h \
wayland-server-protocol.h \
wayland-server.h \
wayland-client-protocol.h \
wayland-client.h \
libwayland-server.so : \
wayland-protocol.o \
wayland-server.o \
event-loop.o \
connection.o \
wayland-util.o \
wayland-hash.o
libwayland-client.so : \
wayland-protocol.o \
wayland-client.o \
connection.o \
wayland-util.o \
wayland-hash.o
wayland-server.o : wayland-server-protocol.h
wayland-client.o : wayland-client-protocol.h
wayland-protocol.c : protocol.xml scanner
./scanner code < $< > $@
wayland-server-protocol.h : protocol.xml scanner
./scanner server-header < $< > $@
wayland-client-protocol.h : protocol.xml scanner
./scanner client-header < $< > $@
$(libs) : CFLAGS += -fPIC $(FFI_CFLAGS)
$(libs) : LDLIBS += $(FFI_LIBS)
$(libs) :
gcc -shared $^ $(LDLIBS) -o $@
scanner : \
scanner.o \
wayland-util.o
scanner : LDLIBS += $(EXPAT_LIBS)
install : $(libs)
install -d $(libdir) $(includedir) $(libdir)/pkgconfig
install wayland-server.pc wayland-client.pc $(libdir)/pkgconfig
install $(libs) $(libdir)
install $(headers) $(includedir)
clean :
rm -f scanner *.o *.so .*.deps
rm -f wayland-protocol.c \
wayland-server-protocol.h wayland-client-protocol.h
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
noinst_LTLIBRARIES = libwayland-util.la
include_HEADERS = \
wayland-util.h \
wayland-server-protocol.h \
wayland-server.h \
wayland-client-protocol.h \
wayland-client.h
libwayland_util_la_SOURCES = \
connection.c \
connection.h \
wayland-util.c \
wayland-util.h \
wayland-hash.c
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-util.la
libwayland_server_la_SOURCES = \
wayland-protocol.c \
wayland-server.c \
event-loop.c
libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-util.la
libwayland_client_la_SOURCES = \
wayland-protocol.c \
wayland-client.c
INCLUDES = $(FFI_CFLAGS)
include $(top_srcdir)/wayland/scanner.mk
noinst_PROGRAMS = scanner
scanner_SOURCES = \
scanner.c
scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
$(BUILT_SOURCES) : scanner
BUILT_SOURCES = \
wayland-server-protocol.h \
wayland-client-protocol.h \
wayland-protocol.c
CLEANFILES = $(BUILT_SOURCES)
foo :
echo $(top_builddir)
\ No newline at end of file
%-protocol.c : $(top_srcdir)/protocol/%.xml
$(top_builddir)/wayland/scanner code < $< > $@
%-server-protocol.h : $(top_srcdir)/protocol/%.xml
$(top_builddir)/wayland/scanner server-header < $< > $@
%-client-protocol.h : $(top_srcdir)/protocol/%.xml
$(top_builddir)/wayland/scanner client-header < $< > $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment