[project @ 1996-11-21 16:45:53 by simonm]
[ghc.git] / mk / Cprog.mk
1 #-----------------------------------------------------------------------------
2 # $Id: Cprog.mk,v 1.2 1996/11/21 16:50:26 simonm Exp $
3
4 # Useful variables:
5
6 # PROG = program name
7 # SRCS = list of sources (optional for one file)
8 # LIBS = libraries
9 # DEPLIBS = more libraries (may depend on $(LIBS)
10 # DESTDIR = where to install
11 # INSTALLED_NAME = name to install as (default = $(PROG))
12
13 #-----------------------------------------------------------------------------
14
15 ifndef INSTALLED_NAME
16 INSTALLED_NAME = $(PROG)
17 endif
18
19 ifndef SRCS
20 SRCS = $(PROG).c
21 endif
22
23 OBJS = $(SRCS:.c=.o)
24
25 all :: $(PROG)
26
27 $(PROG) :: $(OBJS)
28 $(CC) -o $@ $(CFLAGS) $(LDOPTIONS) $(OBJS) $(DEPLIBS) $(LIBS)
29
30 install :: $(PROG)
31 $(INSTALL) $(INSTBINFLAGS) $(PROG) $(DESTDIR)/$(INSTALLED_NAME)
32
33 clean ::
34 $(RM) $(PROG)
35
36 tags ::
37 $(CTAGS) -a $(CTAGSFLAGS) $(SRCS)
38
39 ifndef OmitCDepend
40 C_DEP_SRCS = $(SRCS)
41 include $(TOP)/mk/cdepend.mk
42 endif