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
|
# $Id: Makefile.common,v 5.1 2004/04/27 16:55:24 lirc Exp $
# where the kernel sources are located
KERNEL_LOCATION=@kerneldir@
LIRC_DEVDIR = $(shell pwd)
# some magic for using linux kernel settings
# when compiling module(s)
KBUILD_VERBOSE = 1
LIRC_EXTRA_CFLAGS = -DIRCTL_DEV_MAJOR=$(lirc_major) -DEXPORT_SYMTAB $(DEFS) \
$(DEFAULT_INCLUDES) -I $(LIRC_DEVDIR)/../.. \
-I $(KERNEL_LOCATION)/include/
export LIRC_EXTRA_CFLAGS KERNEL_LOCATION module_DATA
$(module_DATA): $(automake_dummy_SOURCES) $(top_srcdir)/config.h ../lirc.h
mv Makefile Makefile.automake
cp ../Makefile.kernel Makefile
$(MAKE) -C $(KERNEL_LOCATION) SUBDIRS=$(LIRC_DEVDIR) modules \
KBUILD_VERBOSE=$(KBUILD_VERBOSE)
mv Makefile.automake Makefile
install-moduleDATA: $(module_DATA)
$(mkinstalldirs) $(DESTDIR)$(moduledir)
@list='$(module_DATA:.o=.@kernelext@)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(moduledir)/$$f"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(moduledir)/$$f; \
done
uninstall-moduleDATA:
@list='$(module_DATA:.o=.@kernelext@)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f $(DESTDIR)$(moduledir)/$$f"; \
rm -f $(DESTDIR)$(moduledir)/$$f; \
done
if SANDBOXED
else
install-exec-local: mkdev
uninstall-local: rmdev
endif
mkdev:
test -c $(DESTDIR)$(devdir)/lirc || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lirc c @lirc_major@ 0)
rmdev:
-test -c $(DESTDIR)$(devdir)/lirc && $(RM) $(DESTDIR)$(devdir)/lirc
if SANDBOXED
else
install-data-local: install-moduleDATA
-@depmod@ -a
endif
CLEANFILES = $(module_DATA) .$(module_DATA).flags $(module_DATA:.o=.mod.c) $(module_DATA:.o=.@kernelext@) *~
|