Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 123 lines (83 sloc) 3.472 kb
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
1 # gitless Makefile for quIRC
2
3 CC ?= gcc
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
4 OPTFLAGS := -g
5 CFLAGS = -Wall -Wextra -Werror -pedantic -std=gnu99 -D_GNU_SOURCE $(OPTFLAGS)
6 AWK := gawk
7 PREFIX := /usr/local
8 LIBS_ASYNCH_NL := -lanl
9 OPTLIBS = $(LIBS_ASYNCH_NL)
10 LIBS = -lm -lncurses $(OBJS) $(OPTLIBS)
11 OBJS := ttyraw.o ttyesc.o irc.o bits.o strbuf.o ctbuf.o colour.o buffer.o names.o config.o input.o logging.o types.o
12 INCLUDE := $(OBJS:.o=.h) quirc.h version.h osconf.h
13
14 -include config.mak
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
15
62617ff Configurable keymapping
ec429 authored
16 all: quirc doc
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
17
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
18 install: all doc
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
19 install -D -m0755 quirc $(PREFIX)/bin/quirc
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
20 install -D -m0644 quirc.1 $(PREFIX)/man/man1/quirc.1
21 install -D -m0644 readme.htm $(PREFIX)/share/doc/quirc/readme.htm
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
22 install -D -m0644 readme.css $(PREFIX)/share/doc/quirc/readme.css
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
23 install -D -m0644 config_ref.htm $(PREFIX)/share/doc/quirc/config_ref.htm
24 install -D -m0644 tutorial.htm $(PREFIX)/share/doc/quirc/tutorial.htm
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
25
26 uninstall:
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
27 -rm $(PREFIX)/bin/quirc
28 -rm $(PREFIX)/man/man1/quirc.1
29 -rm $(PREFIX)/share/doc/quirc/readme.htm
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
30 -rm $(PREFIX)/share/doc/quirc/readme.css
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
31 -rm $(PREFIX)/share/doc/quirc/config_ref.htm
32 -rm $(PREFIX)/share/doc/quirc/tutorial.htm
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
33
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
34 quirc: quirc.c $(OBJS) $(INCLUDE)
35 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LIBS) $(DEFINES)
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
36
37 quirc.h: config.h version.h
38 touch quirc.h
39
40 clean:
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
41 -rm -f *.o quirc genconfig genkeymap
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
42
43 realclean: clean
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
44 -rm -f c_init.c README version.h config_* keymap.c keymod.h quirc.1
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
45
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
46 doc: README config_ref.htm quirc.1
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
47
48 README: readme.htm
49 -sed -e "s/&apos;/'/g" -e "s/&quot;/\"/g" < readme.htm | html2text -nobs -o README
50
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
51 # warning, this explodes if PREFIX contains a !
52 quirc.1: man.in
53 echo ".\\\"\n.\\\"This man page is automatically generated from man.in by a sedscript; edit man.in, not this file, and 'make doc' to apply the changes.">quirc.1
54 sed -e "s!\$$PREFIX!$(PREFIX)!g" < man.in >> quirc.1
55
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
56 # funky make cleverness to generate object files; a %.o /always/ depends on its %.h as well as its %.c
57
58 %.o: %.c %.h
59 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(DEFINES)
60
61 ttyesc.o: ttyesc.c ttyesc.h bits.h
62
6e37ec8 Update distMakefile; it had fallen out of sync with Makefile
ec429 authored
63 irc.o: irc.c irc.h bits.h buffer.h colour.h names.h numeric.h osconf.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
64
65 irc.h: config.h
66 touch irc.h
67
68 bits.o: bits.c bits.h ttyesc.h colour.h
69
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
70 bits.h: config.h strbuf.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
71 touch bits.h
72
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
73 ctbuf.h: colour.h
74 touch ctbuf.h
75
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
76 colour.o: colour.c colour.h c_init.c ttyesc.h
77
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
78 buffer.o: buffer.c buffer.h ttyesc.h colour.h bits.h names.h text.h irc.h version.h input.h logging.h osconf.h ctbuf.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
79
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
80 buffer.h: config.h version.h logging.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
81 touch buffer.h
82
83 config.o: config.c config.h names.h bits.h colour.h text.h version.h
84
62617ff Configurable keymapping
ec429 authored
85 config.c: config_check.c config_def.c config_need.c config_rcread.c config_pargs.c config_help.c keymap.c
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
86 touch config.c
87
62617ff Configurable keymapping
ec429 authored
88 config.h: config_globals.h version.h keymod.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
89 touch config.h
90
91 config_%: config.cdl genconfig
92 ./genconfig $@ < config.cdl > $@ || (rm $@ && false)
93
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
94 genconfig: genconfig.c strbuf.h strbuf.o
95 $(CC) $(CFLAGS) $(CPPFLAGS) $< $(LDFLAGS) strbuf.o -o $@
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
96
62617ff Configurable keymapping
ec429 authored
97 input.h: keymod.h
98 touch input.h
99
8c8b00d Logging
ec429 authored
100 input.o: input.c input.h ttyesc.h names.h buffer.h irc.h bits.h config.h logging.h
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
101
102 input.c: config_set.c
103 touch input.c
104
8c8b00d Logging
ec429 authored
105 logging.o: types.h bits.h
106
7fbe18a Makefile fixes (should fix gitlessing tarballs) & some plans
ec429 authored
107 names.o: names.c names.h buffer.h irc.h
108
109 script.o: script.c script.h bits.h buffer.h
110
111 c_init.c: colour.d c_init.awk
112 $(AWK) -f c_init.awk colour.d > c_init.c
113
999def1 @ec429 Makefile: de-duplicate the main body as between Makefile and distMakefil...
authored
114 genkeymap: genkeymap.c strbuf.h strbuf.o
115 $(CC) $(CFLAGS) $(CPPFLAGS) $< $(LDFLAGS) strbuf.o -o $@
62617ff Configurable keymapping
ec429 authored
116
117 keymod.h: keys genkeymap
118 ./genkeymap h < keys > $@ || (rm $@ && false)
119
120 keymap.c: keys genkeymap
121 ./genkeymap c < keys > $@ || (rm $@ && false)
122
Something went wrong with that request. Please try again.