forked from torvalds/uemacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
164 lines (141 loc) · 4.56 KB
/
Makefile
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
# makefile for emacs, updated Sun Apr 28 17:59:07 EET DST 1996
# Make the build silent by default
V =
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q
uname_S := Linux
PROGRAM=em
SRC=ansi.c basic.c bind.c buffer.c crypt.c debug.c display.c eval.c exec.c \
file.c fileio.c ibmpc.c input.c isearch.c line.c lock.c main.c \
pklock.c posix.c random.c region.c search.c spawn.c tcap.c \
termio.c vmsvt.c vt52.c window.c word.c names.c globals.c version.c \
usage.c wrapper.c utf8.c util.c
OBJ=ansi.o basic.o bind.o buffer.o crypt.o debug.o display.o eval.o exec.o \
file.o fileio.o ibmpc.o input.o isearch.o line.o lock.o main.o \
pklock.o posix.o random.o region.o search.o spawn.o tcap.o \
termio.o vmsvt.o vt52.o window.o word.o names.o globals.o version.o \
usage.o wrapper.o utf8.o util.o
HDR=ebind.h edef.h efunc.h epath.h estruct.h evar.h util.h version.h
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
CC?=gcc
WARNINGS=-Wall -Wstrict-prototypes
CFLAGS?=-O2 $(WARNINGS) -g
#CC=c89 +O3 # HP
#CFLAGS= -D_HPUX_SOURCE -DSYSV
#CFLAGS=-O4 -DSVR4 # Sun
#CFLAGS=-O -qchars=signed # RS/6000
ifeq ($(uname_S),Linux)
DEFINES=-DAUTOCONF -DPOSIX -DUSG -D_XOPEN_SOURCE=600 -D_GNU_SOURCE
endif
ifeq ($(uname_S),FreeBSD)
DEFINES=-DAUTOCONF -DPOSIX -DSYSV -D_FREEBSD_C_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=600
endif
ifeq ($(uname_S),Darwin)
DEFINES=-DAUTOCONF -DPOSIX -DSYSV -D_DARWIN_C_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=600
endif
#DEFINES=-DAUTOCONF
#LIBS=-ltermcap # BSD
LIBS=-lcurses -ltermcap -lc # SYSV
#LIBS=-ltermlib
#LIBS=-L/usr/lib/termcap -ltermcap
LFLAGS=-hbx
BINDIR=$(DESTDIR)/usr/bin
LIBDIR=$(DESTDIR)/usr/lib
$(PROGRAM): $(OBJ)
$(E) " LINK " $@
$(Q) $(CC) $(LDFLAGS) -static $(DEFINES) -o $@ $(OBJ) $(LIBS)
SPARSE=sparse
SPARSE_FLAGS=-D__LITTLE_ENDIAN__ -D__x86_64__ -D__linux__ -D__unix__
sparse:
$(SPARSE) $(SPARSE_FLAGS) $(DEFINES) $(SRC)
clean:
$(E) " CLEAN"
$(Q) rm -f $(PROGRAM) core lintout makeout tags makefile.bak *.o
install: $(PROGRAM)
mkdir -p ${BINDIR}
mkdir -p ${LIBDIR}
cp em ${BINDIR}
cp emacs.hlp ${LIBDIR}
cp emacs.rc ${LIBDIR}/.emacsrc
cp em.rc ${LIBDIR}/em.rc
chmod 755 ${BINDIR}/em
chmod 644 ${LIBDIR}/emacs.hlp ${LIBDIR}/.emacsrc
lint: ${SRC}
@rm -f lintout
lint ${LFLAGS} ${SRC} >lintout
cat lintout
errs:
@rm -f makeout
make em >makeout
tags: ${SRC}
@rm -f tags
ctags ${SRC}
source:
@mv makefile makefile.bak
@echo "# makefile for emacs, updated `date`" >makefile
@echo '' >>makefile
@echo SRC=`ls *.c` >>makefile
@echo OBJ=`ls *.c | sed s/c$$/o/` >>makefile
@echo HDR=`ls *.h` >>makefile
@echo '' >>makefile
@sed -n -e '/^# DO NOT ADD OR MODIFY/,$$p' <makefile.bak >>makefile
depend: ${SRC}
@for i in ${SRC}; do\
cc ${DEFINES} -M $$i | sed -e 's, \./, ,' | grep -v '/usr/include' | \
awk '{ if ($$1 != prev) { if (rec != "") print rec; \
rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
END { print rec }'; done >makedep
@echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
@echo '$$r ./makedep' >>eddep
@echo 'w' >>eddep
@cp makefile makefile.bak
@ed - makefile <eddep
@rm eddep makedep
@echo '' >>makefile
@echo '# DEPENDENCIES MUST END AT END OF FILE' >>makefile
@echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >>makefile
@echo '# see make depend above' >>makefile
.c.o:
$(E) " CC " $@
$(Q) ${CC} ${CFLAGS} ${DEFINES} -c $*.c
# DO NOT DELETE THIS LINE -- make depend uses it
ansi.o: ansi.c estruct.h edef.h
basic.o: basic.c estruct.h edef.h
bind.o: bind.c estruct.h edef.h epath.h
buffer.o: buffer.c estruct.h edef.h
crypt.o: crypt.c estruct.h edef.h
display.o: display.c estruct.h edef.h utf8.h
eval.o: eval.c estruct.h edef.h evar.h
exec.o: exec.c estruct.h edef.h
file.o: file.c estruct.h edef.h
fileio.o: fileio.c estruct.h edef.h
ibmpc.o: ibmpc.c estruct.h edef.h
input.o: input.c estruct.h edef.h
isearch.o: isearch.c estruct.h edef.h
line.o: line.c estruct.h edef.h
lock.o: lock.c estruct.h edef.h
main.o: main.c estruct.h efunc.h edef.h ebind.h
pklock.o: pklock.c estruct.h
posix.o: posix.c estruct.h utf8.h
random.o: random.c estruct.h edef.h
region.o: region.c estruct.h edef.h
search.o: search.c estruct.h edef.h
spawn.o: spawn.c estruct.h edef.h
tcap.o: tcap.c estruct.h edef.h
termio.o: termio.c estruct.h edef.h
utf8.o: utf8.c utf8.h
vmsvt.o: vmsvt.c estruct.h edef.h
vt52.o: vt52.c estruct.h edef.h
window.o: window.c estruct.h edef.h
word.o: word.c estruct.h edef.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above