summaryrefslogtreecommitdiffstats
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile77
1 files changed, 77 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..f0fc283
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,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
+