root/foundation-apps/grosview-maxx/Makefile

Revision 2, 4.7 KB (checked in by emasson, 3 years ago)

initial import for the community edition

Line 
1#
2# Top level Makefile Template for xosview.
3#
4#
5# $Id: Makefile.top.in,v 1.1.1.1 2008/05/04 15:53:49 emasson Exp $
6#
7include Makefile.config
8
9OBJS = \
10llist.o \
11Host.o \
12xwin.o \
13Xrm.o \
14defaultstring.o \
15meter.o \
16fieldmeter.o \
17fieldmeterdecay.o \
18fieldmetergraph.o \
19bitfieldmeter.o \
20bitmeter.o \
21xosview.o \
22main.o
23
24CFILES := $(OBJS:.o=.cc)
25DEPFILES := $(OBJS:%=.%.d)
26
27INSTALL            = /usr/bin/install -c
28
29#-----------------------------------------------------------------------
30
31all : meterlib xosview
32
33defaultstring.cc: Xdefaults defresources.awk
34        gawk -f defresources.awk Xdefaults > defaultstring.cc
35
36meterlib:
37        cd ./linux && $(MAKE)
38
39./linux/libmeter.a: meterlib
40
41##  Also use LDFLAGS, which is inherited from the system.
42xosview: $(OBJS) ./linux/libmeter.a
43        $(CXX) $(LDFLAGS) $(LFLAGS) -o xosview $(OBJS) $(LIBS)
44
45##  If for some reason (such as permissions) you wish to change where
46##    xosview is installed, re-run configure with
47##    --prefix=<path>, which will change the next line.
48PREFIX_TO_USE=/usr/X11R6
49BINDIR=$(PREFIX_TO_USE)/bin
50MANDIR=$(PREFIX_TO_USE)/share/man/man1
51XAPPLOADDIR=$(PREFIX_TO_USE)/lib/X11/app-defaults
52PACKAGENAME=xosview-$(VERS)
53DISTRIBDIR=./../$(PACKAGENAME)
54
55##  These next lines look really ugly.  The echo statements are an
56##    attempt to make the output look a little nicer.
57install: xosview
58        @echo "***  Installing executable..."
59        ${INSTALL} -m 755 xosview $(BINDIR)
60        @echo "***  Installing application defaults..."
61        ${INSTALL} -m 644 Xdefaults $(XAPPLOADDIR)/XOsview
62        @echo "***  Making sure $(MANDIR) exists..."
63        @if [ ! -d $(MANDIR) ]; then \
64          echo "***  Making $(MANDIR)..."; \
65          mkdir $(MANDIR); \
66        fi
67        @echo "***  Installing man page..."
68        ${INSTALL} -m 644 xosview.1 $(MANDIR)
69
70install-man:
71        @echo "Use the 'install' target -- it installs the man page, too."
72        @#${INSTALL} -m 644 xosview.1 $(MANDIR)
73
74distrib: checksource distclean
75        cd ./..; rm -rf $(PACKAGENAME)
76        mkdir $(DISTRIBDIR)
77        (cd .; tar cf - *) | (cd $(DISTRIBDIR); tar xf -)
78        cd $(DISTRIBDIR); rm -rf `find . -name "CVS"`
79        cd ./..; tar cf $(PACKAGENAME).tar $(PACKAGENAME)
80        gzip -f9 ./../$(PACKAGENAME).tar
81        cd ./..; uuencode $(PACKAGENAME).tar.gz \
82          $(PACKAGENAME).tar.gz > $(PACKAGENAME).tar.gz.uue
83
84#  The next one is only used by bgrayson to set up the local
85#  mirrors of the xosview distributions.
86distrib-and-copy: distrib
87        cp ../$(PACKAGENAME).tar.gz `echo ~bgrayson/public_html/xosview`
88        scp ../$(PACKAGENAME).tar.gz omni:~bgrayson/public_html/xosview
89
90clean :
91        @echo "***  Cleaning..."
92        @cd linux && $(MAKE) clean
93        @#  Only clean the config directory if it exists...
94        @sh -c 'if [ -d config ]; then \
95            echo "***  Cleaning config directory..."; \
96            cd config && $(MAKE) clean; fi'
97        rm -f xosview $(OBJS) $(DEPFILES) *~ defaultstring.cc
98
99checksource:
100        @#  Check that certain unsafe things aren't in any of the
101        @#  code.
102        @echo "***  Grep'ing for uses of strcmp, sprintf, strcat, strcmp,"
103        @echo "     strcasecmp instead of safer strncmp, snprintf, strncat,"
104        @echo "     strncmp, strncasecmp...."
105        @#  If egrep finds no matches, it returns as if it is an
106        @#  error.  Reverse that error code....
107        @#  We also should not check snprintf.cc, which calls vsprintf.
108        @sh -c 'egrep "strcmp|sprintf|strcat|strcmp|strcasecmp" \
109                `echo *.cc *.h */*.cc */*.h | sed -e 's/snprintf.cc//'`; \
110                if [ $$? != 0 ]; then exit 0; else \
111                echo "***  Bad functions found -- error!"; exit 1; fi'
112        @#  Also check that the version in the man page is the
113        @#  same as the one in the Makefile, VERS.
114        @echo "***  Checking for consistent version in config/Makefile.top.in and man page..."
115        @#  This is a tricky little thing, since both 'make' and
116        @#  'sh' try to deal with the embedded $3 for awk.
117        @sh -c 'manver=`sed -ne 2p xosview.1 | awk \{print\ \\$$3\}`; \
118          manver2=`sed -ne 3p xosview.1 | awk \{print\ \\$$3\}`; \
119          if [ x"$$manver" != x"$$manver2" ]; then \
120            echo "!!!  Version mismatch in the man page file xosview.1:"; \
121            echo "     $$manver in SCCS header (line 2),"; \
122            echo "     $$manver2 in title (line 3)."; \
123            exit 1; \
124          fi; \
125          if [ x"$$manver" != x"$(VERS)" ]; then \
126            echo "!!!  Apparent version mismatch:  "; \
127            echo "      $(VERS) in config/Makefile.top.in,"; \
128            echo "      $$manver in man page file xosview.1"; exit 1; \
129          fi'
130
131distclean: clean
132        @#  Also check _all_ subdirs, not just the configured one, for
133        @#  object files.
134        @echo "***  Checking for any missed .o files..."
135        @sh -c 'objects=`find . -name "*.o" -print`; if [ x"$$objects" != x ]; then \
136          echo "The following object files still need to be removed:";\
137          echo $$objects; exit 1; fi'
138        @echo "***  Removing all Makefiles..."
139        @rm -f Makefile Makefile.config Makefile.GNU.autodep \
140           linux/Makefile config.cache config.log config.status
141
142
143maintainer-clean: distclean
144        rm -f configure
145
Note: See TracBrowser for help on using the browser.