1 # A generic buildfiles to build single executable directory projects depending
2 # only on pkg-config ability to build. It automatically names the project on
3 # the toplevel directory you're in.
5 # Setting additional CFLAGS like $ export CFLAGS=-Wall -Werror # can help you
6 # track issues down better after compilation.
9 # Øyvind Kolås (c) 2007 <pippin@gimp.org> placed in the Public Domain.
12 PKGMODULES = tidy-1.0 clutter-0.8 webkit-clutter-1.0
14 # you only need to change the following if you want to change where the
15 # generated tarball gets scp'd to:
17 SCP_DESTINATION=pug.vpn:tmp
19 BINARY=$(shell basename `pwd`)#
20 PACKAGE=../$(BINARY).tar.bz2 # you can use both .gz and .bz2 as extension here
24 # end of template configuration.
27 # This makefile uses the current directory as the only target binary, and
28 # expects a single of the .c files to contain a main function.
34 # The help available also contains brief information about the different
35 # build rules supported.
38 @echo 'Available targets in this make system'
40 @echo ' (none) builds $(BINARY)'
41 @echo ' dist create $(PACKAGE)'
42 @echo ' clean rm *.o *~ and foo and bar'
43 @echo ' run ./$(BINARY)'
44 @echo ' gdb gdb ./$(BINARY)'
45 @echo ' gdb2 gdb ./$(BINARY) --g-fatal-warnings'
46 @echo ' scp scp $(PACKAGE) $(SCP_DESTINATION)'
47 @echo ' help this help'
51 LIBS= $(shell pkg-config --libs $(PKGMODULES) | sed -e 's/-Wl,\-\-export\-dynamic//')
52 INCS= $(shell pkg-config --cflags $(PKGMODULES))
55 CFILES = $(wildcard *.c)
56 OBJECTS = $(subst ./,,$(CFILES:.c=.o))
57 HFILES = $(wildcard *.h)
59 $(CC) -g $(CFLAGS) $(INCS) -c $< -o$@
61 $(CC) -o $@ $(OBJECTS) $(LIBS)
64 # $(LD) $(CFLAGS) $(INCS) $(CFILES) $(LIBS) -o $@
69 ../$(BINARY).tar.gz: clean $(CFILES) $(HFILES)
70 cd ..;tar czvhf $(BINARY).tar.gz $(BINARY)/*
71 @ls -slah ../$(BINARY).tar.gz
72 ../$(BINARY).tar.bz2: clean $(CFILES) $(HFILES)
73 cd ..;tar cjvhf $(BINARY).tar.bz2 $(BINARY)/*
74 @ls -slah ../$(BINARY).tar.bz2
79 scp $(PACKAGE) $(SCP_DESTINATION)
82 gdb --args ./$(BINARY)
84 gdb --args ./$(BINARY) -demo --g-fatal-warnings
86 rm -fvr *.o $(BINARY) *~ *.patch