Makefile
author viric@llimona
Sat, 09 Feb 2008 11:56:03 +0100
changeset 196 bca29e2a1a86
parent 183 95d49e8a8cec
child 204 cd474500b9e1
child 205 c0559c4696f3
permissions -rw-r--r--
Fixing a bug related to a message on -t on last job, when it was skipped.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
     1
PREFIX?=/usr/local
121
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
     2
GLIBCFLAGS=-D_XOPEN_SOURCE=500 -D__STRICT_ANSI__
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
     3
CFLAGS=-pedantic -ansi -Wall -g -O0
32
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     4
OBJECTS=main.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     5
	server.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     6
	server_start.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     7
	client.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     8
	msgdump.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
     9
	jobs.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
    10
	execute.o \
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
    11
	msg.o \
71
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 48
diff changeset
    12
	client_run.o \
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 88
diff changeset
    13
	mail.o \
95
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
    14
	error.o \
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 109
diff changeset
    15
	signals.o \
146
5e689cb593aa Bones of the "-i" parameter, job info.
viric@llimona
parents: 133
diff changeset
    16
	list.o \
5e689cb593aa Bones of the "-i" parameter, job info.
viric@llimona
parents: 133
diff changeset
    17
	print.o \
147
e173645f5221 Added environment info through TS_ENV
viric@llimona
parents: 146
diff changeset
    18
	info.o \
174
c112f67965fb Our implementation of -t (equivalent tail -f), which now
viric@llimona
parents: 173
diff changeset
    19
	env.o \
c112f67965fb Our implementation of -t (equivalent tail -f), which now
viric@llimona
parents: 173
diff changeset
    20
	tail.o
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    21
INSTALL=/usr/bin/install -c
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 18
diff changeset
    22
88
bdd6018f66fd Fixed the declaration warnings in the compilation.
lbatlle@npdl268.bpo.hp.com
parents: 85
diff changeset
    23
all: ts
bdd6018f66fd Fixed the declaration warnings in the compilation.
lbatlle@npdl268.bpo.hp.com
parents: 85
diff changeset
    24
133
4306e96f5906 Added setsid when going background.
viric@llimona
parents: 121
diff changeset
    25
tsretry: tsretry.c
4306e96f5906 Added setsid when going background.
viric@llimona
parents: 121
diff changeset
    26
83
94945f1c7326 Fixed a wrong makefile. Stupid me.
viric@llimona
parents: 79
diff changeset
    27
ts: $(OBJECTS)
121
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
    28
	$(CC) $(LDFLAGS) -o ts $^
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
    29
183
95d49e8a8cec Updating 'help' and some other related files to 0.5
viric@llimona
parents: 174
diff changeset
    30
# Test our 'tail' implementation.
173
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    31
ttail: tail.o ttail.o
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    32
	$(CC) $(LDFLAGS) -o ttail $^
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    33
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    34
121
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
    35
.c.o:
7a42c36de0d0 Added notes about portability.
viric@llimona
parents: 120
diff changeset
    36
	$(CC) $(CFLAGS) $(GLIBCFLAGS) -c $<
83
94945f1c7326 Fixed a wrong makefile. Stupid me.
viric@llimona
parents: 79
diff changeset
    37
79
f99c2548fac4 Updated tricks.
viric@llimona
parents: 78
diff changeset
    38
# Dependencies
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    39
main.o: main.c main.h
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    40
server_start.o: server_start.c main.h
118
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    41
server.o: server.c main.h
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    42
client.o: client.c main.h
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    43
msgdump.o: msgdump.c main.h
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    44
jobs.o: jobs.c main.h
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    45
execute.o: execute.c main.h
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    46
msg.o: msg.c main.h
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    47
client_run.o: client_run.c main.h
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    48
mail.o: mail.c main.h
118
f45aad564b6e Fixed makefile, after removing msg.h
viric@llimona
parents: 117
diff changeset
    49
error.o: error.c main.h
95
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
    50
signals.o: signals.c main.h
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 109
diff changeset
    51
list.o: list.c main.h
173
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    52
tail.o: tail.c main.h
b572fdd206f4 Adding some code base for our implementation of 'tail'.
viric@llimona
parents: 163
diff changeset
    53
ttail.o: ttail.c main.h
32
3531439f2770 Tail works.
viric@llimona
parents: 30
diff changeset
    54
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 18
diff changeset
    55
clean:
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 18
diff changeset
    56
	rm -f *.o ts
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    57
109
45c496d5cb0e Fixed make install, depending on ts.
viric@llimona
parents: 95
diff changeset
    58
install: ts
78
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    59
	$(INSTALL) -d $(PREFIX)/bin
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    60
	$(INSTALL) ts $(PREFIX)/bin
e4d5907f5aaf Added manpage and make install.
viric@llimona
parents: 71
diff changeset
    61
	$(INSTALL) -d $(PREFIX)/man/man1
163
820fb5d34e9c Man page on PREFIX/share/man/man1 . Version of the manpage.
viric@mandarina
parents: 147
diff changeset
    62
	$(INSTALL) -m 644 ts.1 $(PREFIX)/share/man/man1