blob: 7e8845268edb8bb90a63cfaf1fdb52d11a983d5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# A generic buildfiles to build single executable directory projects depending
# only on pkg-config ability to build. It automatically names the project on
# the toplevel directory you're in.
#
# Setting additional CFLAGS like $ export CFLAGS=-Wall -Werror # can help you
# track issues down better after compilation.
#
# 20071008
# Øyvind Kolås (c) 2007 <pippin@gimp.org> placed in the Public Domain.
##
PKGMODULES = clutter-gegl-0.7
# you only need to change the following if you want to change where the
# generated tarball gets scp'd to:
SCP_DESTINATION=pug.vpn:tmp
BINARY=$(shell basename `pwd`)#
PACKAGE=../$(BINARY).tar.bz2 # you can use both .gz and .bz2 as extension here
CFLAGS=-Wall
LIBS = -rdynamic
##
# end of template configuration.
#
# This makefile uses the current directory as the only target binary, and
# expects a single of the .c files to contain a main function.
all: $(BINARY)
# The help available also contains brief information about the different
# build rules supported.
help:
@echo ''
@echo 'Available targets in this make system'
@echo ''
@echo ' (none) builds $(BINARY)'
@echo ' dist create $(PACKAGE)'
@echo ' clean rm *.o *~ and foo and bar'
@echo ' run ./$(BINARY)'
@echo ' gdb gdb ./$(BINARY)'
@echo ' gdb2 gdb ./$(BINARY) --g-fatal-warnings'
@echo ' scp scp $(PACKAGE) $(SCP_DESTINATION)'
@echo ' help this help'
@echo ''
LIBS+= $(shell pkg-config --libs $(PKGMODULES) | sed -e 's/-Wl,\-\-export\-dynamic//')
INCS= $(shell pkg-config --cflags $(PKGMODULES))
CFILES = $(wildcard *.c)
OBJECTS = $(subst ./,,$(CFILES:.c=.o))
HFILES = $(wildcard *.h)
%.o: %.c $(HFILES)
$(CC) -g $(CFLAGS) $(INCS) -c $< -o$@
$(BINARY): $(OBJECTS)
$(CC) -o $@ $(OBJECTS) $(LIBS)
#$(BINARY): $(CFILES)
# $(LD) $(CFLAGS) $(INCS) $(CFILES) $(LIBS) -o $@
test: run
run: $(BINARY)
./$(BINARY)
../$(BINARY).tar.gz: clean $(CFILES) $(HFILES)
cd ..;tar czvhf $(BINARY).tar.gz $(BINARY)/*
@ls -slah ../$(BINARY).tar.gz
../$(BINARY).tar.bz2: clean $(CFILES) $(HFILES)
cd ..;tar cjvhf $(BINARY).tar.bz2 $(BINARY)/*
@ls -slah ../$(BINARY).tar.bz2
dist: $(PACKAGE)
echo $(PACKAGE)
scp: dist
scp $(PACKAGE) $(SCP_DESTINATION)
gdb: all
gdb --args ./$(BINARY)
gdb2: all
gdb --args ./$(BINARY) -demo --g-fatal-warnings
clean:
rm -fvr *.o $(BINARY) *~ *.patch
|