File: Makefile

package info (click to toggle)
gtimer 0.96-1
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 340 kB
  • ctags: 279
  • sloc: ansic: 3,409; makefile: 137
file content (164 lines) | stat: -rw-r--r-- 5,059 bytes parent folder | download
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# GTimer Makefile
#
# Copyright:
#	(C) 1998 Craig Knudsen, cknudsen@radix.net
#	See accompanying file "COPYING".
# 
#	This program is free software; you can redistribute it and/or
#	modify it under the terms of the GNU General Public License
#	as published by the Free Software Foundation; either version 2
#	of the License, or (at your option) any later version.
# 
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
# 
#	You should have received a copy of the GNU General Public License
#	along with this program; if not, write to the
#	Free Software Foundation, Inc., 59 Temple Place,
#	Suite 330, Boston, MA  02111-1307, USA
#

# Set the GTK version number
# minor and micro must be two digits (99 or 01, etc.)
# major should be blank for 0 (otherwise, it's treated as an octal)
GTK_MAJOR_VERSION	= 
GTK_MINOR_VERSION	= 99
GTK_MICRO_VERSION	= 09
GTK_VERSION	= $(GTK_MAJOR_VERSION)$(GTK_MINOR_VERSION)$(GTK_MICRO_VERSION)
CFLAGS	= -O2 -Wall -DGTKVERSION=$(GTK_VERSION)
LIBS	=
LDFLAGS = -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
VERSION = unknown
DIR	= gtimer-$(VERSION)
DESTDIR = /usr/X11R6/bin

gtimer: main.o edit.o annotate.o report.o confirm.o config.o task.o
	$(CC) main.o edit.o report.o annotate.o confirm.o config.o task.o \
	$(LIBS) $(LDFLAGS) -o gtimer


# to build this, you need the memdebug library I wrote.
debug:
	make "CFLAGS=-g -Wall -DGTIMER_MEMDEBUG -DGTKVERSION=$(GTK_VERSION)" "LIBS=memdebug/libmd.a"

tasktest: tasktest.o task.o
	$(CC) tasktest.o task.o $(LIBS) -o tasktest

main.o: main.c task.h gtimer.h
	$(CC) $(CFLAGS) main.c -c -o main.o

report.o: report.c task.h gtimer.h
	$(CC) $(CFLAGS) report.c -c -o report.o

edit.o: edit.c task.h gtimer.h
	$(CC) $(CFLAGS) edit.c -c -o edit.o

annotate.o: annotate.c task.h gtimer.h
	$(CC) $(CFLAGS) annotate.c -c -o annotate.o

confirm.o: confirm.c task.h gtimer.h
	$(CC) $(CFLAGS) confirm.c -c -o confirm.o

config.o: config.c config.h
	$(CC) $(CFLAGS) config.c -c -o config.o

task.o: task.c task.h
	$(CC) $(CFLAGS) task.c -c -o task.o

tasktest.o: tasktest.c task.h
	$(CC) $(CFLAGS) tasktest.c -c -o tasktest.o


#
# The "dist" target is used for creating the .tar.gz and .tar.bz2
# distributions.
#
dist:
	make "VERSION=`./get_version.pl`" targz bzip

version:
	echo "Version is `./get_version.pl`"

gz targz: gtimer-$(VERSION).tar.gz

bzip bzip2: gtimer-$(VERSION).tar.bz2

gtimer-$(VERSION).tar.gz: gtimer
	echo "Building version $(VERSION) .tar.gz"; \
	if [ ! -d $(DIR) ]; then \
	  ln -s . $(DIR); \
	fi; \
	tar cvf - $(DIR)/README $(DIR)/COPYING \
	$(DIR)/gtimer.1 $(DIR)/Makefile \
	$(DIR)/confirm.c $(DIR)/edit.c $(DIR)/annotate.c $(DIR)/main.c \
	$(DIR)/report.c $(DIR)/task.c \
	$(DIR)/task.h $(DIR)/gtimer.h \
	$(DIR)/config.c $(DIR)/config.h \
	$(DIR)/icons/*xpm $(DIR)/icons/gtimer.gif | \
	gzip -c > gtimer-$(VERSION).tar.gz

gtimer-$(VERSION).tar.bz2:
	echo "Building version $(VERSION) .tar.bz2"; \
	if [ ! -d $(DIR) ]; then \
	  ln -s . $(DIR); \
	fi; \
	tar cvf - $(DIR)/README $(DIR)/COPYING \
	$(DIR)/gtimer.1 $(DIR)/Makefile \
	$(DIR)/confirm.c $(DIR)/edit.c $(DIR)/annotate.c $(DIR)/main.c \
	$(DIR)/report.c $(DIR)/task.c \
	$(DIR)/task.h $(DIR)/gtimer.h \
	$(DIR)/config.c $(DIR)/config.h \
	$(DIR)/icons/*xpm $(DIR)/icons/gtimer.gif | \
	bzip2 --repetitive-best > gtimer-$(VERSION).tar.bz2

# for building the man page
buildman:
	d=`grep GTIMER_VERSION_DATE gtimer.h | \
	  awk '-F"' '{ print $$2 }' | \
	  awk '{ printf "%s %s, %s\n", $$2, $$1, $$3 }'`; \
	make "VERSION=`./get_version.pl`" "DATE=$$d" gtimer.1

gtimer.1: gtimer.man gtimer.h
	sed 's;VERSION;$(VERSION);g' gtimer.man | \
	  sed 's;DATE;$(DATE);g' > gtimer.1

clean:
	rm -f *.o *~ gtimer core

distclean: clean

install:
	install -o root -m 0755 `pwd`/gtimer $(DESTDIR)

all: clean gtimer install

makefile:
	@sed -n '1,/^# DEPEND/ p' Makefile > Makefile.new; \
	make -s depend >> Makefile.new; \
	mv Makefile Makefile.old; \
	mv Makefile.new Makefile
	

depend:
	@for i in `ls -1 *.c`; do \
	  o=`echo $$i | sed "s;\.c;.o;"`; \
	  echo "$$o: " | tr -d '\012'; \
	  gcc -M $$i | sed -n '2,$$ p' | tr -d '\\' | tr '\012' ' ' | tr ' ' '\012' | grep -v '/usr/' | grep '[a-z]' | tr '\012' ' '; \
	  echo ""; \
	done

############################################################################
# DEPEND
annotate.o: task.h gtimer.h 
config.o: config.h 
confirm.o: task.h gtimer.h icons/error.xpm icons/confirm.xpm icons/about.xpm 
edit.o: task.h gtimer.h 
main.o: task.h gtimer.h config.h icons/splash.xpm icons/clock1.xpm icons/clock2.xpm icons/clock3.xpm icons/clock4.xpm icons/clock5.xpm icons/clock6.xpm icons/clock7.xpm icons/clock8.xpm icons/blank.xpm icons/start.xpm icons/stop.xpm icons/stop_all.xpm icons/annotate.xpm icons/new.xpm icons/edit.xpm 
report.o: task.h gtimer.h config.h 
report.v95.o: task.h gtimer.h 
task.o: task.h 
tasktest.o: task.h 
template.o: template.h 
xextras.o: