summaryrefslogtreecommitdiffstats
path: root/GNUmakefile
blob: f0fc283851e17cb90c704459d5cff4986e485088 (plain)
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
# config
srcdir	= .
VPATH	= $(srcdir)
-include Make.config
include $(srcdir)/mk/Variables.mk

# fixup flags
CFLAGS	+= -DVERSION='"$(VERSION)"'

# default target
all: build

# what to build
TARGETS := record
LDLIBS	:= -lncurses


#################################################################
# poor man's autoconf ;-)

include $(srcdir)/mk/Autoconf.mk

define make-config
LIB			:= $(LIB)
HAVE_SOUNDCARD_H	:= $(call ac_header,soundcard.h)
HAVE_SYS_SOUNDCARD_H	:= $(call ac_header,sys/soundcard.h)
HAVE_LIBOSSAUDIO	:= $(call ac_lib,main,ossaudio,)
endef


########################################################################
# conditional stuff

includes        = SOUNDCARD_H SYS_SOUNDCARD_H
libraries       = OSSAUDIO

OSSAUDIO_LDLIBS	:= -lossaudio

CFLAGS		+= $(call ac_inc_cflags,$(includes))
LDFLAGS		+= $(call ac_lib_mkvar,$(libraries),LDFLAGS)


########################################################################
# rules for record

record: record.o


########################################################################
# general rules

.PHONY: build install clean distclean realclean
build: $(TARGETS)

install: build
	$(INSTALL_DIR) $(bindir)
	$(INSTALL_DIR) $(mandir)/man1
	$(INSTALL_BINARY) $(TARGETS) $(bindir)
	$(INSTALL_DATA) $(srcdir)/record.man $(mandir)/man1/record.1

clean:
	-rm -f *.o $(depfiles) core core.*

realclean distclean: clean
	-rm -f Make.config
	-rm -f $(TARGETS) *~


include $(srcdir)/mk/Compile.mk
-include $(depfiles)


########################################################################
# maintainer stuff

include $(srcdir)/mk/Maintainer.mk