Initial Import
[profile/ivi/clutter-toys.git] / attic / mallums-magic-browser / Makefile
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.
4 #
5 # Setting additional CFLAGS like $ export CFLAGS=-Wall -Werror # can help you
6 # track issues down better after compilation.
7 #
8 # 20071008
9 # Øyvind Kolås (c) 2007 <pippin@gimp.org>  placed in the Public Domain.
10 ##
11
12 PKGMODULES = tidy-1.0 clutter-0.8 webkit-clutter-1.0
13
14 # you only need to change the following if you want to change where the
15 # generated tarball gets scp'd to:
16
17 SCP_DESTINATION=pug.vpn:tmp
18
19 BINARY=$(shell basename `pwd`)#
20 PACKAGE=../$(BINARY).tar.bz2 # you can use both .gz and .bz2 as extension here
21
22
23 ##
24 # end of template configuration.
25 #
26
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.
29
30
31
32 all: $(BINARY)
33
34 # The help available also contains brief information about the different
35 # build rules supported.
36 help: 
37         @echo ''
38         @echo 'Available targets in this make system'
39         @echo ''
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'
48         @echo ''
49
50
51 LIBS= $(shell pkg-config --libs $(PKGMODULES) | sed -e 's/-Wl,\-\-export\-dynamic//')
52 INCS= $(shell pkg-config --cflags $(PKGMODULES))
53
54
55 CFILES  = $(wildcard *.c)
56 OBJECTS = $(subst ./,,$(CFILES:.c=.o))
57 HFILES  = $(wildcard *.h)
58 %.o: %.c $(HFILES)
59         $(CC) -g $(CFLAGS) $(INCS) -c $< -o$@
60 $(BINARY): $(OBJECTS)
61         $(CC) -o $@ $(OBJECTS) $(LIBS)
62
63 #$(BINARY): $(CFILES)
64 #       $(LD) $(CFLAGS) $(INCS) $(CFILES) $(LIBS) -o $@
65 test: run
66 run: $(BINARY)
67         ./$(BINARY)
68
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
75
76 dist: $(PACKAGE) 
77         echo $(PACKAGE) 
78 scp: dist
79         scp $(PACKAGE) $(SCP_DESTINATION)
80
81 gdb: all
82         gdb --args ./$(BINARY)
83 gdb2: all
84         gdb --args ./$(BINARY) -demo --g-fatal-warnings
85 clean:
86         rm -fvr *.o $(BINARY) *~ *.patch