]> err.no Git - sope/blob - libFoundation/examples/GNUmakefile.alone
tweaked layout
[sope] / libFoundation / examples / GNUmakefile.alone
1 # GNUmakefile
2 #
3 # Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
4 # All rights reserved.
5 #
6 # Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
7 #
8 # This file is part of libFoundation.
9 #
10 # Permission to use, copy, modify, and distribute this software and its
11 # documentation for any purpose and without fee is hereby granted, provided
12 # that the above copyright notice appear in all copies and that both that
13 # copyright notice and this permission notice appear in supporting
14 # documentation.
15 #
16 # We disclaim all warranties with regard to this software, including all
17 # implied warranties of merchantability and fitness, in no event shall
18 # we be liable for any special, indirect or consequential damages or any
19 # damages whatsoever resulting from loss of use, data or profits, whether in
20 # an action of contract, negligence or other tortious action, arising out of
21 # or in connection with the use or performance of this software.
22
23 TOP     = ..
24 OBJDIR  = obj
25
26 include $(TOP)/config.mak
27
28 LIB     = $(TOP)/lib
29 LIBS    := -lFoundation $(LIBS)
30
31 .SUFFIXES: .m .h $(objext)
32
33 DEFAULTS        = $(OBJDIR)/Defaults$(exeext)
34
35 all: $(OBJDIR) $(DEFAULTS) .gdbinit
36
37 DEFAULTSM = Defaults.m
38
39 DEFAULTSO = $(addprefix $(OBJDIR)/, $(DEFAULTSM:.m=$(objext)))
40
41 CFLAGS += -I../Foundation
42
43 $(DEFAULTS): $(DEFAULTSO)
44         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(DEFAULTSO) -L$(LIB) -L$(libdir) $(LIBS)
45
46 #
47 # Other rules
48 #
49
50 $(addprefix $(OBJDIR)/, %$(objext)) : %.m
51         $(CC) $(CFLAGS) $(DEBUGFLAGS) -c $< -o $(OBJDIR)/$(@F)
52
53 $(OBJDIR):
54         mkdir $@
55
56 clean:
57         rm -rf $(OBJDIR) .gdbinit t
58
59 distclean: clean
60         rm -f GNUmakefile
61
62 install:
63         if test ! -d $(bindir); then mkdir $(bindir); fi
64         $(INSTALL_PROGRAM) $(DEFAULTS) $(bindir)/Defaults$(exeext)
65
66 uninstall:
67         rm $(exec_prefix)/$(DEFAULTS)
68
69 .gdbinit:
70         @echo Making $@...
71         @echo define make >$@
72         @echo shell $(MAKE) >>$@
73         @echo end >>$@
74         @echo dir . $(TOP)/Foundation >>$@
75         @echo view >>$@
76