File: Makefile

package info (click to toggle)
sl-modem 2.9.9d%2Be-pre2-7etch2
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 2,436 kB
  • ctags: 1,719
  • sloc: ansic: 10,780; sh: 548; makefile: 256; perl: 11
file content (77 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
###########################################################################
#
#
#       Makefile  --  modem application Makefile.
#
#       Copyright(c) 2003, Smart Link Ltd. (www.smlink.com)
#	All rights reserved.
#
#       Author: Sasha K (sashak@smlink.com)
#
#
###########################################################################
#
###########################################################################

CC:= gcc
RM:= rm -f

CFLAGS:= -Wall -g -O -I. -DCONFIG_DEBUG_MODEM


modem-objs:= \
	modem.o modem_datafile.o modem_at.o modem_timer.o \
	modem_pack.o modem_ec.o modem_comp.o \
	modem_param.o modem_debug.o homolog_data.o
dp-objs:= dp_sinus.o dp_dummy.o
sysdep-objs:= sysdep_common.o

all: slmodemd modem_test

slmodemd: modem_main.o modem_cmdline.o $(modem-objs) $(dp-objs) dsplibs.o $(sysdep-objs)
modem_test: modem_test.o modem_cmdline.o $(modem-objs) $(dp-objs) dsplibs.o $(sysdep-objs)

#SUPPORT_ALSA:=1
ifdef SUPPORT_ALSA
slmodemd: -lasound
CFLAGS+= -DSUPPORT_ALSA=1
endif

slmodemd modem_test:
	$(CC) -o $@ $^

clean:
	$(RM) slmodemd modem_test modem_main.o modem_cmdline.o modem_test.o $(modem-objs) $(dp-objs) $(sysdep-objs)
	$(RM) *~ *.orig *.rej

.PHONY: all dep generic-dep clean clean-build-profile


#
# rules
#

%.o: %.c .build_profile
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -o $@ -c $<

dep: generic-dep
generic-dep:
	$(RM) .depend
	$(foreach src,$(wildcard *.c),$(CC) -M $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(src:.c=.o)) -c $(src) >> .depend ;)

-include .depend

# build_profile
-include .build_profile

.build_profile::
ifneq ($(CFLAGS),$(PROFILE_CFLAGS))
	@if [ "$(CFLAGS) $(EXTRA_CFLAGS)" != "$(PROFILE_CFLAGS)" ] ; then \
	  echo "rebuild profile..." ; \
	  echo "PROFILE_CFLAGS=$(CFLAGS) $(EXTRA_CFLAGS)" > $(@) ; fi
endif

clean: clean-build-profile
clean-build-profile:
	@$(RM) -f .build_profile