merge 64-bit fixes from Fernando Lucas Rodriguez <fernando_lr@terra.es>
[debian/gcpegg] / Makefile
1
2 #   Debug options you can define on the following line:
3
4 #       -DALT_UI    --  Select an alternative user interface
5 #                       that doesn't require curses.  This allows
6 #                       running an egg even if there's a problem
7 #                       with terminal configuration.
8 #
9 #       -DDEBUG     --  General debug output
10 #
11 #       -DHEXDUMP   --  Dump network packets sent and received
12 #                       in hexadecimal, identifying the recipient
13 #                       or sender by IP address.  Handy when
14 #                       tracking down byte alignment problems.
15 #
16 #       -DNICE=x    --  Priority increment (positive value) which
17 #                       eggsh raises to while collecting data when
18 #                       run by super-user.  Default is 10.  Setting
19 #                       -DNICE=0 disables the priority adjustment
20 #                       mechanism.
21 #
22 #       -DNO_UI     --  Disable user interface in the egg.  This
23 #                       is handy when you want to watch other
24 #                       debug output.
25 #
26 #       -DPACKETDUMP -- Interpreted dump of packets.
27 #
28 #       -DSTORAGE_DEBUG  -- Debug output from storage.c database
29 #                       functions.
30 #
31 #       -DTESTPORT  --  Use EGGPORT = 2074, BASKETPORT = 2075.
32 #                       This permits testing an experimental
33 #                       version of eggsh and basket on a machine
34 #                       which is running production version(s)
35 #                       on the standard ports.
36 #
37 #       -DUSLEEP    --  Use a built-in emulation of usleep()
38 #                       based on setitimer() instead of the
39 #                       system library function (which may not
40 #                       exist on all flavours of Unix).
41
42 #DEBUGOPTIONS = -DDEBUG -DPACKETDUMP -DTESTPORT -DHEXDUMP -DNO_UI -DSTORAGE_DEBUG
43
44 #DEBUGOPTIONS = -DTESTPORT -DDEBUG -DPACKETDUMP -DNO_UI -DALT_UI
45
46 #DEBUGOPTIONS = -DTESTPORT
47
48 #DEBUGOPTIONS =
49
50 #DEBUGOPTIONS = -DTESTPORT -DALT_UI -DNO_UI
51
52 #DEBUGOPTIONS = -DDEBUG -DALT_UI -DNO_UI
53
54 #DEBUGOPTIONS = -DDEBUG -DNO_UI -DHEXDUMP
55
56 # Build for throop/Orion egg
57 #DEBUGOPTIONS = -DNO_UI -DALT_UI -DDEBUG -DUSLEEP -DFLUSH
58
59 # Current debug options
60 #DEBUGOPTIONS = -DNO_UI -DALT_UI -DDEBUG -DTESTPORT
61
62 DEBUGOPTIONS = -DREPORT=1 -DEGG_DYNAMIC
63
64 #   For Linux with GCC
65 CC = gcc
66 PFLAGS = -g -ansi -Wall -DLinux -DUSLEEP -D_GNU_SOURCE
67 LIBS = -lncurses
68
69 #   For Solaris 2.6 with Sun compiler
70 #CC = cc
71 #PFLAGS = -g -DSolaris
72 #LIBS = -lcurses -lsocket -lnsl
73
74 #   Silicon Graphics Irix 5.3 with SGI compiler.  Yes
75 #   we do define "Solaris" along with "Irix" for such a build.
76 #CC = cc
77 #PFLAGS = -g -DSolaris -DIrix -DUSLEEP
78 #LIBS = -lcurses
79
80 CFLAGS = $(PFLAGS) $(DEBUGOPTIONS)
81
82 HWOBJ = reg_orion.o reg_pear.o reg_pseudo.o
83 APPOBJ = storage.o network.o crc16.o genlib.o xdsub.o
84 EGGOBJ = egg.o eggui.o lecuyer.o usleep.o
85 BASKETOBJ = basket.o
86 TESTOBJ = testmain.o
87
88 PROGRAMS = eggsh basket regtest
89
90 default: $(PROGRAMS)
91
92 all: $(PROGRAMS) tarballs
93
94 eggsh:  $(EGGOBJ) $(HWOBJ) $(APPOBJ)
95         $(CC) $(CFLAGS) -o eggsh $(EGGOBJ) $(HWOBJ) $(APPOBJ) $(LIBS)
96
97 examine: $(APPOBJ) examine.o
98         $(CC) $(CFLAGS) -o examine storage.o crc16.o genlib.o examine.o
99
100 basket: $(BASKETOBJ) $(APPOBJ)
101         $(CC) $(CFLAGS) -o basket $(BASKETOBJ) $(APPOBJ) $(LIBS)
102
103 tarballs: $(PROGRAMS)
104         tar czf eggware.tgz sample.eggrc eggsh regtest README
105         tar czf eggsrc.tgz  sample.eggrc sample.basketrc $(PROGRAMS) README Makefile *.c *.h
106
107 test:   eggsh
108         eggsh 1 9600 200 10 10
109
110 clean:
111         rm -f $(PROGRAMS) *.o *.bak .*.bak core dumpreg.dat egg.status eggsample.pid
112
113 cleandata:
114         rm -rf 199*-*
115
116 basket.o: basket.c global.h genlib.h storage.h network.h version.h
117
118 #collect.o: collect.c global.h genlib.h regs.h collect.h
119
120 egg.o: egg.c global.h genlib.h storage.h network.h regs.h version.h
121
122 eggui.o: eggui.c global.h genlib.h errnos.h eggui.h regs.h version.h
123
124 global.h: byteorder.h
125
126 hw_pear.o: hw_pear.c global.h genlib.h
127
128 lecuyer.o: lecuyer.c
129
130 network.o: network.c global.h genlib.h network.h
131
132 regs.h: reg.h
133
134 reg_orion.o: reg_orion.c reg.h
135
136 reg_pear.o: reg_pear.c reg.h
137
138 reg_pseudo.o: reg_pseudo.c reg.h lecuyer.h
139
140 storage.o: storage.c global.h genlib.h storage.h
141
142 usleep.o: usleep.c