OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [sound/] [Makefile] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
# Makefile for the Linux sound card driver
2
#
3
# Note 2! The CFLAGS definitions are now inherited from the
4
# parent makes. (hopefully)
5
#
6
#
7
 
8
.PHONY: dummy
9
SUB_DIRS        = lowlevel
10
VERSION         = `head -1 .version`
11
TARGET_OS       = linux
12
USRINCDIR       = /usr/include
13
MODULEDIR       = /lib/modules/misc
14
 
15
FIXEDOBJS       = soundcard.o dev_table.o sound_switch.o
16
 
17
ifndef NO_LOWLEVEL
18
        FIXEDOBJS := $(FIXEDOBJS) lowlevel/lowlevel.o
19
endif
20
 
21
ifeq (.defines,$(wildcard .defines))
22
include .defines
23
include .objects
24
else
25
OBJS   = `cat .object_files`
26
endif
27
 
28
ifndef TOPDIR
29
TOPDIR=/usr/src/linux
30
endif
31
 
32
 
33
ifndef HOSTCC
34
build:
35
        @echo Compiling modularized sound driver
36
        @make sound.o
37
        @echo Sound module compiled.
38
 
39
install:        sound.o
40
        cp sound.o $(MODULEDIR)
41
endif
42
 
43
.c.o:
44
        $(CC) $(CFLAGS) -c $<
45
 
46
ifeq ($(CONFIG_SOUND),y)
47
 
48
all:    local.h sound.a
49
 
50
OBJS += $(FIXEDOBJS)
51
 
52
else
53
all:
54
endif
55
 
56
ifndef HOSTCC
57
#
58
#       Running outside the kernel build.
59
#
60
CC      = gcc
61
HOSTCC  = gcc
62
CFLAGS  = -O2 -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -m486
63
USE_DEPEND=y
64
else
65
include $(TOPDIR)/Rules.make
66
endif
67
 
68
sound.a: $(OBJS)
69
        -rm -f sound.a
70
        $(AR) rcs sound.a $(OBJS)
71
        sync
72
 
73
clean:
74
        rm -f core core.* *.o *.a tmp_make *~ x y z *%
75
        rm -f configure sound_stub.c objects/*.o
76
        cd lowlevel;make clean
77
 
78
indent:
79
        for n in *.c;do echo indent $$n;indent $$n;done
80
 
81
local.h:
82
        $(MAKE) clean
83
        $(MAKE) setup-$(TARGET_OS)
84
        $(MAKE) oldconfig
85
        $(MAKE) dep
86
        @echo
87
        @echo
88
        @echo
89
        @echo NOTE! Object file dependencies may not be up to date. Run
90
        @echo make again if kernel/driver doesn''t link properly. Restarting
91
        @echo it now may save some time.
92
        @echo
93
        @echo
94
 
95
config: configure
96
        @$(MAKE) setup-$(TARGET_OS)
97
        @./configure > local.h
98
        @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
99
        @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
100
#       @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
101
#       @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
102
        @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
103
 
104
oldconfig: setup-$(TARGET_OS) configure
105
        @./configure -o > local.h
106
        @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
107
        @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
108
#       @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
109
#       @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
110
        @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
111
 
112
kernelconfig: setup-$(TARGET_OS)
113
        rm -f configure
114
        $(HOSTCC) -o configure configure.c
115
        ./configure fixedlocal > local.h
116
        ./configure fixeddefines > .defines
117
        @echo \#define SOUND_CONFIG_DATE \"`date`\" >> local.h
118
        @echo \#define SOUND_CONFIG_BY \"`whoami`\" >> local.h
119
#       @echo \#define SOUND_CONFIG_HOST \"`hostname`\" >> local.h 2>/dev/null
120
#       @echo \#define SOUND_CONFIG_DOMAIN \"`hostname -d`\" >> local.h 2>/dev/null
121
        @echo \#define SOUND_UNAME_A \"`uname -a`\" >> local.h
122
 
123
mkscript: setup-$(TARGET_OS)
124
        rm -f configure
125
        $(HOSTCC) -o configure configure.c
126
        ./configure script > Config.in
127
        cat lowlevel/Config.tmpl >> Config.in
128
        ./configure fixedlocal > local.h
129
        ./configure fixeddefines > .defines
130
 
131
clrconf:
132
        rm -f local.h .depend synth-ld.h trix_boot.h smw-midi0001.h maui_boot.h .defines
133
 
134
configure: configure.c
135
        $(HOSTCC) -o configure configure.c
136
        @cat .blurb
137
 
138
dep:
139
        $(CPP) -M *.c > .depend
140
 
141
setup-linux:
142
        @echo Compiling Sound Driver v $(VERSION) for Linux
143
 
144
sound.o: local.h $(FIXEDOBJS) sound.a
145
        -rm -f sound.o
146
        $(LD) -r -o sound.o $(FIXEDOBJS) sound.a
147
 
148
modules: local.h sound.o
149
        ln -fs ../drivers/sound/sound.o $(TOPDIR)/modules/sound.o
150
 
151
lowlevel/lowlevel.o: dummy
152
        cd lowlevel; make
153
 
154
ifdef USE_DEPEND
155
#
156
# include a dependency file if one exists
157
#
158
ifeq (.depend,$(wildcard .depend))
159
include .depend
160
endif
161
endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.