Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 123 lines (84 sloc) 3.052 kb
9f0cff1 Initial commit.
Sound and Fury authored
1 # Makefile for quIRC
2
3 CC ?= gcc
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
4 OPTFLAGS = -g
5 CFLAGS ?= -Wall -Wextra -Werror -pedantic -std=gnu99 $(OPTFLAGS)
ac506d8 Generate the default colours from an awk script
Sound and Fury authored
6 AWK ?= gawk
4a2bd9b Fixed bugs in 'make dist'
Sound and Fury authored
7 VERSION := `git describe --tags`
1bf0755 'make install' rule
Sound and Fury authored
8 PREFIX ?= /usr/local
d05545d Fix Makefile bug
Sound and Fury authored
9 LIBS := ttyraw.o ttyesc.o irc.o bits.o colour.o buffer.o names.o config.o input.o
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
10 INCLUDE := ttyraw.h ttyesc.h irc.h bits.h colour.h buffer.h names.h config.h input.h quirc.h version.h
9f0cff1 Initial commit.
Sound and Fury authored
11
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
12 all: quirc doc
9f0cff1 Initial commit.
Sound and Fury authored
13
1bf0755 'make install' rule
Sound and Fury authored
14 install: all
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
15 install -D -m0755 quirc $(PREFIX)/bin/quirc
1bf0755 'make install' rule
Sound and Fury authored
16
4050262 Use a post-commit hook to update version.h (with the Makefile)
Sound and Fury authored
17 uninstall:
18 rm $(PREFIX)/bin/quirc
19
fcf9495 Refactored .quirc and cmdline parsing; other refactoring
Sound and Fury authored
20 quirc: quirc.c $(LIBS) $(INCLUDE)
de4ae60 config: generate much of the config code from a concise descriptions fil...
ec429 authored
21 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LIBS) -lm $(DEFINES)
68d1b71 Use mcheck.h for memory profiling
Sound and Fury authored
22
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
23 quirc.h: config.h version.h
24 touch quirc.h
25
4050262 Use a post-commit hook to update version.h (with the Makefile)
Sound and Fury authored
26 clean:
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
27 -rm *.o quirc genconfig
4050262 Use a post-commit hook to update version.h (with the Makefile)
Sound and Fury authored
28
29 realclean: clean
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
30 -rm c_init.c README version.h config_*
4050262 Use a post-commit hook to update version.h (with the Makefile)
Sound and Fury authored
31
76d7bce HTML Reference table for the genconfig stuff (/set, rc, cmdline options)
ec429 authored
32 doc: README config_ref.htm
6b0feff Canonical readme in HTML format; makerule to generate plain text
Sound and Fury authored
33
34 README: readme.htm
e2c3e47 Fix generation of README (&apos; and &quot;)
ec429 authored
35 -sed -e "s/&apos;/'/g" -e "s/&quot;/\"/g" < readme.htm | html2text -nobs -o README
6b0feff Canonical readme in HTML format; makerule to generate plain text
Sound and Fury authored
36
c408645 Make the Makefile more clever (pattern rules for the object files)
Sound and Fury authored
37 # funky make cleverness to generate object files; a %.o /always/ depends on its %.h as well as its %.c
9f0cff1 Initial commit.
Sound and Fury authored
38
c408645 Make the Makefile more clever (pattern rules for the object files)
Sound and Fury authored
39 %.o: %.c %.h
eb63d03 --debug option, and debugging mode
Sound and Fury authored
40 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(DEFINES)
9f0cff1 Initial commit.
Sound and Fury authored
41
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
42 ttyesc.o: ttyesc.c ttyesc.h bits.h
43
44 irc.o: irc.c irc.h bits.h buffer.h colour.h names.h numeric.h
2b3007c Highlight escape sequences in input line
Sound and Fury authored
45
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
46 irc.h: config.h
47 touch irc.h
9f0cff1 Initial commit.
Sound and Fury authored
48
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
49 bits.o: bits.c bits.h ttyesc.h colour.h
50
51 bits.h: config.h
52 touch bits.h
709dc6b Various improvements eg rc file (.quirc)
Sound and Fury authored
53
fcf9495 Refactored .quirc and cmdline parsing; other refactoring
Sound and Fury authored
54 colour.o: colour.c colour.h c_init.c ttyesc.h
15e4136 Automatic version-number generation from git describe
Sound and Fury authored
55
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
56 buffer.o: buffer.c buffer.h ttyesc.h colour.h bits.h names.h text.h irc.h version.h input.h
a886cb2 Moved name-list handling out to new files 'names.*'
Sound and Fury authored
57
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
58 buffer.h: config.h version.h
59 touch buffer.h
de4ae60 config: generate much of the config code from a concise descriptions fil...
ec429 authored
60
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
61 config.o: config.c config.h names.h bits.h colour.h text.h version.h
de4ae60 config: generate much of the config code from a concise descriptions fil...
ec429 authored
62
62617ff Configurable keymapping
ec429 authored
63 config.c: config_check.c config_def.c config_need.c config_rcread.c config_pargs.c config_help.c keymap.c
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
64 touch config.c
65
62617ff Configurable keymapping
ec429 authored
66 config.h: config_globals.h version.h keymod.h
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
67 touch config.h
68
69 config_%: config.cdl genconfig
de4ae60 config: generate much of the config code from a concise descriptions fil...
ec429 authored
70 ./genconfig $@ < config.cdl > $@ || (rm $@ && false)
71
72 genconfig: genconfig.c
fcf9495 Refactored .quirc and cmdline parsing; other refactoring
Sound and Fury authored
73
62617ff Configurable keymapping
ec429 authored
74 input.h: keymod.h
75 touch input.h
76
77 input.o: input.c input.h ttyesc.h names.h buffer.h irc.h bits.h config.h
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
78
79 input.c: config_set.c
80 touch input.c
861788e More refactoring (input routines etc.)
Sound and Fury authored
81
e7b2bd5 Fix /ignore -d bug (i_cull() dissects prefixes)
Sound and Fury authored
82 names.o: names.c names.h buffer.h irc.h
5ed2685 /ignore -l: lists ignores
Sound and Fury authored
83
4881617 Moved rc from ~/.quirc to ~/.quirc/rc (cherrypicked from script branch)
ec429 authored
84 script.o: script.c script.h bits.h buffer.h
85
ac506d8 Generate the default colours from an awk script
Sound and Fury authored
86 c_init.c: colour.d c_init.awk
87 $(AWK) -f c_init.awk colour.d > c_init.c
88
62617ff Configurable keymapping
ec429 authored
89 genkeymap: genkeymap.c
90
91 keymod.h: keys genkeymap
92 ./genkeymap h < keys > $@ || (rm $@ && false)
93
94 keymap.c: keys genkeymap
95 ./genkeymap c < keys > $@ || (rm $@ && false)
96
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
97 FORCE:
98 version.h: FORCE
fcf9495 Refactored .quirc and cmdline parsing; other refactoring
Sound and Fury authored
99 ./gitversion
25bf8a0 Makefile fixes (because make behaves unhelpfully)
ec429 authored
100 if ! cmp version.h version.h2; then mv version.h2 version.h; fi
101 -rm version.h2
fcf9495 Refactored .quirc and cmdline parsing; other refactoring
Sound and Fury authored
102
959f0a2 make dist also makes doc
Sound and Fury authored
103 dist: all doc
4a2bd9b Fixed bugs in 'make dist'
Sound and Fury authored
104 -mkdir quirc_$(VERSION)
105 for p in $$(ls); do cp $$p quirc_$(VERSION)/$$p; done;
66ea5eb Makefile rule to build a source tarball (and do funky things with versio...
Sound and Fury authored
106 -rm quirc_$(VERSION)/*.tar.gz
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
107 mv quirc_$(VERSION)/distMakefile quirc_$(VERSION)/Makefile
4a2bd9b Fixed bugs in 'make dist'
Sound and Fury authored
108 tar -cvvf quirc_$(VERSION).tar quirc_$(VERSION)/
062c4d0 dist Makefile rule, creates tarball with binaries
Sound and Fury authored
109 gzip quirc_$(VERSION).tar
110 rm -r quirc_$(VERSION)
111
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
112 dists: c_init.c config.c config.h doc
66ea5eb Makefile rule to build a source tarball (and do funky things with versio...
Sound and Fury authored
113 -mkdir quirc_$(VERSION)_src
114 for p in $$(ls); do cp $$p quirc_$(VERSION)_src/$$p; done;
115 -rm quirc_$(VERSION)_src/*.tar.gz
116 rm quirc_$(VERSION)_src/*.o
117 rm quirc_$(VERSION)_src/quirc
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
118 mv quirc_$(VERSION)_src/distMakefile quirc_$(VERSION)_src/Makefile
66ea5eb Makefile rule to build a source tarball (and do funky things with versio...
Sound and Fury authored
119 tar -cvvf quirc_$(VERSION)_src.tar quirc_$(VERSION)_src/
120 gzip quirc_$(VERSION)_src.tar
121 rm -r quirc_$(VERSION)_src
122
Something went wrong with that request. Please try again.