source: sbliveos2/trunk/sblive/Makefile

Last change on this file was 142, checked in by ktk, 25 years ago

Import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1# $Id: Makefile 142 2000-04-23 14:55:46Z ktk $
2
3# Comment/uncomment the following line to disable/enable build options
4DEBUG = n
5KERNELVERSION = auto
6KERNELSOURCE=/usr/src/linux
7
8ifneq ($(shell grep '__rh_kernel_version_h__' $(KERNELSOURCE)/include/linux/version.h),)
9# redhat kernel headers style
10 SUB := $(shell grep __BOOT_KERNEL_ /boot/kernel.h 2>/dev/null | grep 1 | cut -d\_ -f5 | tr [:upper:] [:lower:] | cut -d' ' -f1)
11 VERSION_H := version-$(SUB).h
12 AUTOCONF_H := autoconf-$(SUB).h
13else
14 VERSION_H := version.h
15 AUTOCONF_H := autoconf.h
16endif
17
18ifeq ($(KERNELVERSION),auto)
19 KERNELVERSION := $(shell grep UTS_RELEASE $(KERNELSOURCE)/include/linux/$(VERSION_H) 2>/dev/null | cut -d\" -f2)
20endif
21
22KERNELRELEASE := $(shell echo $(KERNELVERSION) | cut -d\" -f2| cut -c-3)
23
24ifeq ($(KERNELRELEASE),2.2)
25 KERNEL_EXTRA_INCLUDES := -I2.2/
26else
27 ifeq ($(KERNELRELEASE),2.3)
28 KERNELRELEASE := 2.4
29 KERNEL_EXTRA_INCLUDES := -I./
30 endif
31endif
32
33# extract config options from the kernel headers
34dummy := $(shell grep 'define' $(KERNELSOURCE)/include/linux/$(AUTOCONF_H) | grep 'CONFIG' | awk '{ print $$2 "=y"}' - > .config)
35
36include $(KERNELRELEASE)/Makefile
37
38#CFLAGS += -DPRIVATE_PCM_VOLUME
39
40ifeq ($(DEBUG),y)
41 CFLAGS := $(CFLAGS) -DEMU10K1_DEBUG
42endif
43
44CFLAGS := $(CFLAGS) $(MODFLAGS) $(KERNEL_EXTRA_INCLUDES)
45
46EMU10K1 = emu10k1.o
47EMU10K1-JOY = emu10k1-joy.o
48SRC = audio.c cardmi.c cardmo.c cardwi.c cardwo.c efxmgr.c emuadxmg.c\
49 hwaccess.c irqmgr.c main.c midi.c mixer.c osutils.c recmgr.c timer.c voicemgr.c
50
51all: .depend $(EMU10K1) $(EMU10K1-JOY)
52
53$(EMU10K1): $(SRC:.c=.o)
54 $(LD) -r $^ -o $@
55
56install:
57 mkdir -p /lib/modules/$(KERNELVERSION)/misc
58 install -c -m 664 $(EMU10K1) $(EMU10K1-JOY) /lib/modules/$(KERNELVERSION)/misc
59 /sbin/depmod -a $(KERNELVERSION)
60 /sbin/modprobe -r $(EMU10K1) $(EMU10K1-JOY)
61
62clean:
63 rm -f core .config `find . -name '*.[oas]' -o -name '*~' -o -name core -o -name dep -o -name .depend`
64
65depend .depend dep:
66 @if [ ! -f $(KERNELSOURCE)/include/linux/modversions.h ]; then \
67 echo "Please run make dep in your kernel source tree modversions.h is missing" ;\
68 exit 1; fi
69 @echo "Driver for KERNELVERSION = $(KERNELVERSION)"
70 $(CC) $(CFLAGS) -M $(SRC) > $@
71
72ifeq (.depend,$(wildcard .depend))
73include .depend
74endif
75
Note: See TracBrowser for help on using the repository browser.