File: Makefile

package info (click to toggle)
hexer 0.1.4c-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 664 kB
  • ctags: 962
  • sloc: ansic: 12,584; makefile: 135
file content (145 lines) | stat: -rw-r--r-- 3,425 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
#  Makefile for hexer version 0.1.4c

#  It might be helpful to read the `README'-file first.

#  -- Where? --
#  The following lines determine where the binaries and manual pages for
#  hexer are gonna live.
PREFIX = $(DESTDIR)/usr
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1

#  -- Which terminal library? --
#  (It's probably save to leave the following lines unchanged.)
#
#  Use the following two lines, if you want to use the termcap-library.
#TERMLIB =
#TERMCAP = -ltermcap -lm
#
#  Uncomment these if you want to use curses.
TERMLIB =
TERMCAP = -lcurses
#
#  Uncomment the following two lines if you want to use the termlib code
#  supplied with the package (not recommended).
#TERMLIB = termlib.o
#TERMCAP =

#  If you want to add some system specific defines, it's probably more
#  appropriate to put them into `config.h'.
DEFINES = -DHEXER_VERSION=\"0.1.4c\"

#  -- Which compiler? --
CC = cc
CFLAGS = -O $(DEFINES)
LDFLAGS =
LDLIBS = $(TERMCAP) -lm
#
#  Uncomment the following lines if you want to use the GNU compiler.
#CC = gcc
#CFLAGS = -O6 $(DEFINES)
#LDFALGS =
#LDLIBS = $(TERMCAP)

#  -- Which installer? --
INSTALL = install
INSTALLBIN = $(INSTALL) -s
INSTALLMAN = $(INSTALL) -m 644
#
#  Uncomment these if you don't have an installer.
#INSTALL = cp
#INSTALLBIN = $(INSTALL)
#INSTALLMAN = $(INSTALL)

###  It shouldn't be necessary to change anything below this line.

HEXER = hexer
MYC = myc

CTAGS = ctags -tawf tags

OBJECTS = buffer.o tio.o edit.o main.o hexer.o readline.o regex.o port.o \
          exh.o set.o map.o signal.o util.o commands.o helptext.o calc.o \
	  $(TERMLIB)

all: config.check $(HEXER)

config.check:
	@{  if [ ! -f config.h ]; then \
	      echo '***' Please read the file README on how to configure and; \
	      echo '***' compile hexer.\  Thank you.; \
	      exit 1; \
	    fi; }

$(HEXER): $(OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS)

$(MYC): calc.c
	$(CC) $(LDFLAGS) $(CFLAGS) -DMYCALC=1 -o $@ calc.c -lm

bin2c: bin2c.c
	$(CC) -o $@ bin2c.c

helptext.c: help.txt bin2c
	./bin2c -n helptext -o $@ help.txt

tags: *.c *.h
	-@{ \
	  echo Creating tags...; \
	  rm -f tags; \
	  for i in *.c *.h; do \
            echo $(CTAGS) $$i; \
	    $(CTAGS) $$i; \
	  done; \
	}

dep: depend

depend: *.c *.h
	-rm -f Makefile~
	sed '/\#\#\# DO NOT DELETE THIS LINE \#\#\#/q' \
	  < Makefile > Makefile~
	-echo >> Makefile~
	-echo '#' Dependencies: >> Makefile~
	-echo >> Makefile~
	@{ for i in *.c; do \
	      echo $(CC) -MM $(CINCLUDE) $(CFLAGS) $$i '>>' Makefile~; \
	      $(CC) -MM $(CINCLUDE) $(CFLAGS) $$i >> Makefile~; \
	    done; }
	-echo >> Makefile~
	mv -f Makefile~ Makefile
	-touch depend

clean:
	-rm -f $(HEXER)
	-rm -f $(MYC)
	-rm -f TESTFILE
	-rm -f gen_testfile
	-rm -f $(OBJECTS)
	-rm -f tags
	-rm -f core
	-rm -f *.bak

distclean: clean
	-rm -f Makefile~
	sed '/\#\#\# DO NOT DELETE THIS LINE \#\#\#/q' \
	  < Makefile > Makefile~
	-echo >> Makefile~
	mv -f Makefile~ Makefile
	-rm -f depend

install: all
	@{  echo installing $(HEXER) in $(BINDIR); \
	    $(INSTALLBIN) $(HEXER) $(BINDIR); \
	    echo installing $(HEXER).1 in $(MANDIR); \
	    $(INSTALLMAN) $(HEXER).1 $(MANDIR); \
	    if [ -f $(MYC) ]; then \
	      echo installing $(MYC) in $(BINDIR); \
	      $(INSTALLBIN) $(MYC) $(BINDIR); \
	      echo installing $(MYC).1 in $(MANDIR); \
	      $(INSTALLMAN) $(MYC).1 $(MANDIR); \
	    fi; }


### DO NOT DELETE THIS LINE ###