-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (81 loc) · 2.1 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
prefix=/usr/local
MAKE=make
CC=gcc
GCC_MAJOR=3
HOST_CC=gcc
AR=ar
STRIP=strip -s -R .comment -R .note
CFLAGS=-O2
LDFLAGS=
EXTRALIBS=-lm -ldl
VERSION=0.3.5
CFLAGS:=-fno-strict-aliasing -Wall -g $(CFLAGS)
# use it for gcc >= 4.7.0
#CFLAGS+=-Wno-unused-but-set-variable
#CFLAGS+=-Werror
ifdef TARGET_GPROF
CFLAGS+= -p
LDFLAGS+= -p
endif
ifdef TARGET_ARCH_X86
#CFLAGS+=-fomit-frame-pointer
ifeq ($(GCC_MAJOR),2)
CFLAGS+=-m386 -malign-functions=0
else
CFLAGS+=-march=i386 -falign-functions=0
endif
endif
DEFINES=-DHAVE_QE_CONFIG_H
APP_NAME=hoe
########################################################
# do not modify after this
LIBS+=-ldl
# export some qemacs symbols
LDFLAGS+=-Wl,-E
LIBS+=-lm
TARGETS+=$(APP_NAME)
OBJS=qe.o charset.o buffer.o input.o display.o util.o hex.o list.o cutils.o \
unix.o tty.o unihex.o pylang.o clang.o latex-mode.o bufed.o dired.o \
unicode_join.o patch-mode.o cscope.o rect_operations.o shell.o qeend.o
all: $(TARGETS) plugins
.PHONY: plugins
plugins:
@echo "(MAKE) plugins"
@make -C plugins all
$(APP_NAME): $(OBJS) $(DEP_LIBS)
@echo "(LINK) $@"
@$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
qe.o: qe.c qe.h qestyles.h config.h
charset.o: charset.c qe.h qestyles.h
buffer.o: buffer.c qe.h qestyles.h
tty.o: tty.c qe.h qestyles.h
qfribidi.o: qfribidi.c qfribidi.h
%.o : %.c
@echo "(CC) $<"
@$(CC) $(DEFINES) $(CFLAGS) -o $@ -c $<
clean:
make -C plugins clean
rm -f *.o *~ TAGS gmon.out core \
$(APP_NAME) qfribidi
install: $(APP_NAME)
install -s -m 755 $(APP_NAME) $(prefix)/bin/$(APP_NAME)
plugin_install:
make -C plugins install
TAGS: force
etags *.[ch]
force:
#
# tar archive for distribution
#
FILES=Changelog COPYING README.md config.eg Makefile \
hex.c charset.c qe.c qe.h tty.c unicode_join.c input.c \
qeconfig.h qeend.c unihex.c util.c bufed.c qestyles.h buffer.c \
qfribidi.c clang.c latex-mode.c xml.c dired.c list.c qfribidi.h \
display.c display.h shell.c VERSION cutils.c cutils.h unix.c
FILE=$(APP_NAME)-$(shell cat VERSION)
tar:
rm -rf /tmp/$(FILE)
mkdir -p /tmp/$(FILE)
cp -r . /tmp/$(FILE)
( cd /tmp ; tar zcvf $(FILE).tar.gz $(FILE) )
rm -rf /tmp/$(FILE)