-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (37 loc) · 938 Bytes
/
Makefile
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
# This currently builds a user space program and not a useful library
CFLAGS= -Wall -g -ansi -pedantic
LDFLAGS= -L. -lmsr
LIB= libmsr.a
LIBSRCS= libmsr.c serialio.c msr206.c makstripe.c
LIBOBJS= $(LIBSRCS:.c=.o)
DAB= dab
DABSRCS= dab.c
DABOBJS= $(DABSRCS:.c=.o)
DMSB= dmsb
DMSBSRCS= dmsb.c
DMSBOBJS= $(DMSBSRCS:.c=.o)
SUBDIRS=utils
all: $(LIB)
for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) all); \
done
$(LIB): $(LIBOBJS)
ar rcs $(LIB) $(LIBOBJS)
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<
install:
install -m644 -D $(LIB) $(DESTDIR)/usr/$(LIB)
for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) install); \
done
AUDIOLDFLAGS=-lsndfile
$(DAB): $(DABOBJS)
$(CC) -o $(DAB) $(DABOBJS) $(AUDIOLDFLAGS)
$(DMSB): $(DMSBOBJS)
$(CC) -o $(DMSB) $(DMSBOBJS) $(AUDIOLDFLAGS)
audio: $(DAB) $(DMSB)
clean:
rm -rf *.o *~ $(LIB) $(DAB) $(DMSB)
for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) clean); \
done