]>
Commit | Line | Data |
---|---|---|
1 | # config | |
2 | srcdir = . | |
3 | VPATH = $(srcdir) | |
4 | -include Make.config | |
5 | include $(srcdir)/mk/Variables.mk | |
6 | ||
7 | CFLAGS += -Wall -Wno-pointer-sign | |
8 | CFLAGS += -DVERSION='"$(VERSION)"' | |
9 | ||
10 | TARGETS := amtterm | |
11 | DESKTOP := $(wildcard *.desktop) | |
12 | ||
13 | all: build | |
14 | ||
15 | ################################################################# | |
16 | # poor man's autoconf ;-) | |
17 | ||
18 | include mk/Autoconf.mk | |
19 | ||
20 | define make-config | |
21 | LIB := $(LIB) | |
22 | HAVE_GTK := $(call ac_pkg_config,gtk+-x11-2.0) | |
23 | HAVE_VTE := $(call ac_pkg_config,vte) | |
24 | endef | |
25 | ||
26 | ################################################################# | |
27 | ||
28 | # build gamt? | |
29 | ifeq ($(HAVE_GTK)$(HAVE_VTE),yesyes) | |
30 | TARGETS += gamt | |
31 | gamt : CFLAGS += -Wno-strict-prototypes | |
32 | gamt : pkglst += gtk+-x11-2.0 vte | |
33 | endif | |
34 | ||
35 | CFLAGS += $(shell test "$(pkglst)" != "" && pkg-config --cflags $(pkglst)) | |
36 | LDLIBS += $(shell test "$(pkglst)" != "" && pkg-config --libs $(pkglst)) | |
37 | ||
38 | ################################################################# | |
39 | ||
40 | build: $(TARGETS) | |
41 | ||
42 | install: build | |
43 | $(INSTALL_DIR) $(bindir) $(appdir) $(mandir)/man1 $(mandir)/man7 | |
44 | $(INSTALL_BINARY) $(TARGETS) $(bindir) | |
45 | $(INSTALL_SCRIPT) amttool $(bindir) | |
46 | $(INSTALL_DATA) $(DESKTOP) $(appdir) | |
47 | $(INSTALL_DATA) gamt.man $(mandir)/man1/gamt.1 | |
48 | $(INSTALL_DATA) amtterm.man $(mandir)/man1/amtterm.1 | |
49 | $(INSTALL_DATA) amttool.man $(mandir)/man1/amttool.1 | |
50 | $(INSTALL_DATA) amt-howto.man $(mandir)/man7/amt-howto.7 | |
51 | ||
52 | clean: | |
53 | rm -f *.o *~ | |
54 | rm -f $(TARGETS) | |
55 | ||
56 | distclean: clean | |
57 | rm -f Make.config | |
58 | ||
59 | ################################################################# | |
60 | ||
61 | amtterm: amtterm.o redir.o tcp.o | |
62 | gamt: gamt.o redir.o tcp.o parseconfig.o | |
63 | ||
64 | ################################################################# | |
65 | ||
66 | include mk/Compile.mk | |
67 | include mk/Maintainer.mk | |
68 | -include $(depfiles) |