File: Makefile

package info (click to toggle)
multimon 1.0-7.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 576 kB
  • ctags: 924
  • sloc: ansic: 8,144; makefile: 233; perl: 41
file content (95 lines) | stat: -rw-r--r-- 2,131 bytes parent folder | download | duplicates (2)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
DEBUG		=n
OS		=$(shell uname)
ARCHITECTURE	=$(shell dpkg --print-architecture)

CFLAGS		+=-Wall -Wstrict-prototypes -I/usr/X11R6/include
ifeq ($(OS),SunOS)
ifeq ($(DEBUG),y)
CFLAGS		+=-g -O -DSUN_AUDIO -DARCH_SPARC
else
CFLAGS		+=-O3 -DSUN_AUDIO -DARCH_SPARC
endif
LDFLAGSX	+=-lX11 -L/usr/X11R6/lib -R/usr/X11R6/lib -lsocket -lnsl
else
ifeq ($(DEBUG),y)
CFLAGS		+=-g -O
else
CFLAGS		+=-O3
endif
ifeq ($(ARCHITECTURE),i386)
CFLAGS		+=  -march=i486 -falign-loops=2 -falign-jumps=2 \
		  -falign-functions=2 -DARCH_I386
endif
LDFLAGSX	+=-lX11 -L/usr/X11R6/lib
endif


BINDIR		=bin-$(shell uname -m)

AS86		=as86 -0 -a
LD86		=ld86 -0

AS		=as
LD		=ld
LDFLAGS		+=-lm
HOSTCC		=gcc
CC		=gcc
MAKE		=make
CPP		=$(CC) -E
AR		=ar
STRIP		=strip
MKDIR		=mkdir

all:		$(BINDIR) $(BINDIR)/multimon $(BINDIR)/gen

$(BINDIR)/%.s:	%.c
		$(CC) $(CFLAGS) -S -o $@ $<

$(BINDIR)/%.o:	$(BINDIR)/%.s
		$(AS) -c -o $@ $<

$(BINDIR)/%.o:	%.c
		$(CC) $(CFLAGS) -c -o $@ $<

SRC_L2		=hdlc.c pocsag.c
SRC_L1		=demod_afsk12.c demod_afsk24.c demod_afsk24_2.c
SRC_L1		+=demod_hapn48.c demod_fsk96.c demod_eas.c
SRC_L1		+=demod_poc5.c demod_poc12.c demod_poc24.c
SRC_L1		+=demod_dtmf.c demod_zvei.c demod_ccir.c demod_display.c
SRC_MISC	=unixinput.c costabf.c xdisplay.c

SRC_GEN		=gen.c gen_dtmf.c gen_sin.c gen_zvei.c gen_ccir.c gen_hdlc.c costabi.c

OBJ_L2		=$(SRC_L2:%.c=$(BINDIR)/%.o)
OBJ_L1		=$(SRC_L1:%.c=$(BINDIR)/%.o)
OBJ_MISC	=$(SRC_MISC:%.c=$(BINDIR)/%.o)

OBJ_GEN		=$(SRC_GEN:%.c=$(BINDIR)/%.o)

$(BINDIR):
		$(MKDIR) $(BINDIR)

$(BINDIR)/multimon:	$(OBJ_L2) $(OBJ_L1) $(OBJ_MISC)
			$(CC) $^ $(LDFLAGS) $(LDFLAGSX) -o $@

$(BINDIR)/gen:		$(OBJ_GEN)
			$(CC) $^ $(LDFLAGS) -o $@

$(BINDIR)/mkcostab:	$(BINDIR)/mkcostab.o
			$(CC) $^ $(LDFLAGS) -o $@

costabi.c costabf.c:	$(BINDIR)/mkcostab
			$(BINDIR)/mkcostab

clean:
		$(RM) -f core `find . -name '*.[oas]' -print`
		$(RM) -f core `find . -name 'core' -print`
		$(RM) -f core costabi.c costabf.c *~


depend dep:
		$(CPP) -M $(CFLAGS) $(SRC_MISC) $(SRC_L1) $(SRC_L2) $(SRC_GEN) mkcostab.c > $(BINDIR)/.depend

ifeq ($(BINDIR)/.depend,$(wildcard $(BINDIR)/.depend))
include $(BINDIR)/.depend
endif