/[openvortex]/aureal-1.x/Makefile
ViewVC logotype

Diff of /aureal-1.x/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by hash, Mon May 5 14:44:19 2003 UTC revision 1.4 by hash, Wed Aug 13 09:50:19 2003 UTC
# Line 19  Line 19 
19  # Contact: http://aureal.sourceforge.net  # Contact: http://aureal.sourceforge.net
20  #  #
21    
22  ifneq ($(shell /sbin/lspci -d '12eb:3'),)  
23  NAME = au8810  # Select the compiler
24  ASP_OBJ = asp10.o  CC = gcc
25  endif  ifeq ($(findstring GCC,$(shell $(CC) --version)),GCC)
26  ifneq ($(shell /sbin/lspci -d '12eb:1'),)  CC_VERSION = $(shell $(CC) -dumpversion | cut -d. -f1)
 NAME = au8820  
 ASP_OBJ = asp20.o  
27  endif  endif
28  ifneq ($(shell /sbin/lspci -d '12eb:2'),)  ifeq ($(findstring GCC,$(shell $(CC) --version)),)
29  NAME = au8830    ifeq ($(findstring gcc,$(shell $(CC) -v 2>&1)),gcc)
30  ASP_OBJ = asp30.o      CC_VERSION = $(shell $(CC) -dumpversion | cut -d. -f1)
31      endif
32  endif  endif
33    
34    
35  PROCESSOR_TYPE = $(shell uname -m)  PROCESSOR_TYPE = $(shell uname -m)
36  ifeq ($(PROCESSOR_TYPE),i486)  ifeq ($(PROCESSOR_TYPE),i486)
37  CPU = 486  CPU = 486
# Line 43  ifeq ($(PROCESSOR_TYPE),i686) Line 43  ifeq ($(PROCESSOR_TYPE),i686)
43  CPU = pentiumpro  CPU = pentiumpro
44  endif  endif
45    
 CC = gcc  
 ifeq ($(CC),gcc)  
 CC_VERSION=$(shell gcc -dumpversion | cut -d. -f1)  
 endif  
   
46  ifeq ($(CC_VERSION),2)  ifeq ($(CC_VERSION),2)
47  CFCPU = -m$(CPU)  CFCPU = -m$(CPU)
48  endif  endif
49  ifeq ($(CC_VERSION),3)  ifeq ($(CC_VERSION),3)
50  CFCPU = -mcpu=$(CPU)  CFCPU = -mcpu=$(CPU)
51  endif  endif
52    ifeq ($(CFCPU),)
53    $(error Incompatible Version of '$(CC)': $(CC_VERSION))
54    endif
55    
56    
57    # Detect the chip on the soundcard
58    ifneq ($(shell /sbin/lspci -d '12eb:3'),)
59    NAME = au8810
60    endif
61    ifneq ($(shell /sbin/lspci -d '12eb:1'),)
62    NAME = au8820
63    endif
64    ifneq ($(shell /sbin/lspci -d '12eb:2'),)
65    NAME = au8830
66    endif
67    
68    # This part is separated from the above for the 'make au88x0' target
69    # Need to modify the gcc2 compiled object files if using gcc3
70    # asp10.o - 167118 byte - on 16byte line 0002:8cc0 (167104) 14th byte (0-15)
71    # asp20.o - 140542 byte - on 16byte line 0002:24f0 (140528) 14th byte (0-15)
72    # asp30.o - 173078 byte - on 16byte line 0002:a410 (173072) 6th byte (0-15)
73    ifeq ($(NAME),au8810)
74    ASP_OBJ = asp10.o
75    ASP_OBJ_PATCHED = asp10-patched.o
76    ASP_OBJ_PATCH_BYTE = 167118
77    endif
78    ifeq ($(NAME),au8820)
79    ASP_OBJ = asp20.o
80    ASP_OBJ_PATCHED = asp20-patched.o
81    ASP_OBJ_PATCH_BYTE = 140542
82    endif
83    ifeq ($(NAME),au8830)
84    ASP_OBJ = asp30.o
85    ASP_OBJ_PATCHED = asp30-patched.o
86    ASP_OBJ_PATCH_BYTE = 173078
87    endif
88    
89    
90  KERNEL_VERSION = $(shell uname -r)  KERNEL_VERSION = $(shell uname -r)
# Line 89  PPCS = $(SRCS:.c=.i) Line 120  PPCS = $(SRCS:.c=.i)
120  ASMS = $(SRCS:.c=.s)  ASMS = $(SRCS:.c=.s)
121  OBJS = $(SRCS:.c=.o)  OBJS = $(SRCS:.c=.o)
122  TGTS = au88*.o  TGTS = au88*.o
123    ALL_ASP_OBJ_PATCHED = asp*0-patched.o
124    
125    
126  all: compile  all: compile
# Line 109  install: compile Line 141  install: compile
141          /sbin/depmod -a          /sbin/depmod -a
142    
143  compile: $(DEPS) $(OBJS) $(ASP_OBJ)  compile: $(DEPS) $(OBJS) $(ASP_OBJ)
144    # Need to modify the gcc2 compiled object files if using gcc3
145    ifeq ($(CC_VERSION),3)
146            $(shell cp $(ASP_OBJ) $(ASP_OBJ_PATCHED))
147            $(shell echo '3' | dd of=$(ASP_OBJ_PATCHED) bs=1 seek=$(ASP_OBJ_PATCH_BYTE) count=1 conv=notrunc > /dev/null 2>&1)
148            $(LD) -m elf_i386 -r $(OBJS) $(ASP_OBJ_PATCHED) -o $(NAME).o
149    endif
150    ifeq ($(CC_VERSION),2)
151          $(LD) -m elf_i386 -r $(OBJS) $(ASP_OBJ) -o $(NAME).o          $(LD) -m elf_i386 -r $(OBJS) $(ASP_OBJ) -o $(NAME).o
152    endif
153    
154  au8810:  au8810:
155          $(MAKE) compile NAME=au8810 ASP_OBJ=asp10.o          $(MAKE) compile NAME=au8810
156    
157  au8820:  au8820:
158          $(MAKE) compile NAME=au8820 ASP_OBJ=asp20.o          $(MAKE) compile NAME=au8820
159    
160  au8830:  au8830:
161          $(MAKE) compile NAME=au8830 ASP_OBJ=asp30.o          $(MAKE) compile NAME=au8830
162    
163  depend dep: $(DEPS)  depend dep: $(DEPS)
164          @echo "Dependancies are now up to date."          @echo "Dependancies are now up to date."
# Line 142  semiclean: Line 182  semiclean:
182    
183  clean:  clean:
184          $(MAKE) semiclean          $(MAKE) semiclean
185          -rm -f $(TGTS)          -rm -f $(TGTS) $(ALL_ASP_OBJ_PATCHED)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26