source: trunk/minix/commands/mdb/Makefile@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 2.7 KB
RevLine 
[9]1#
2# Makefile for mdb
3#
4#
5# Edit as indicated below.
6#
7USR =/usr
8#
9# (1) For Compiler and target system:
10#
11#
12# For ANSI C and Minix 1.7.x 32-bit
13#
14CC =exec cc
15LD =exec cc
16LDFLAGS =-i
17TARGET =mdb
18STACK =200000
19#
20# (2) If kernel and mm are not in "/usr/src" change this
21#
22SYSTEM =$(USR)/src
23#
24# (3) Select Options
25#
26# i) For GNU_EXEC Support, uncomment:
27#
28#FOR_GNU =gnu_sym.o gnu_load.o
29#DEF_GNU =-DGNU_SUPPORT
30#
31# ii) For tracing of syscalls, uncomment:
32#
33#FOR_SYSCALLS =syscalls.o decode.o ioctl.o
34#DEF_SYSCALLS =-DSYSCALLS_SUPPORT
35#
36# iii) For no debugging of mdb, uncomment:
37#
38#DEF_DEBUG =-DNDEBUG
39
40EXTRA_OBJS =$(FOR_GNU) $(FOR_SYSCALLS)
41EXTRA_DEFS =$(DEF_GNU) $(DEF_SYSCALLS) $(DEF_DEBUG)
42
43all: $(TARGET)
44
45CFLAGS =-I$(SYSTEM) -I$(SYSTEM)/servers -I$(INCLUDE) -D_MINIX -D_POSIX_SOURCE $(EXTRA_DEFS)
46
47# For various included files or system files
48#
49INCLUDE =$(USR)/include
50KERNEL =$(SYSTEM)/kernel
51PTRACE =$(INCLUDE)/sys/ptrace.h
52
53
54# Header files from pm (used by core.c)
55#
56MMFILES= $(SYSTEM)/servers/pm/const.h \
57 $(SYSTEM)/servers/pm/type.h \
58 $(SYSTEM)/servers/pm/mproc.h
59
60# Header files from system and kernel in "mdb.h"
61#
62SYSFILES= $(INCLUDE)/minix/config.h \
63 $(INCLUDE)/minix/const.h \
64 $(INCLUDE)/ansi.h \
65 $(INCLUDE)/minix/type.h \
66 $(INCLUDE)/limits.h \
67 $(INCLUDE)/errno.h \
68 $(INCLUDE)/sys/types.h \
69 $(KERNEL)/const.h \
70 $(KERNEL)/type.h \
71 $(KERNEL)/proc.h
72
73# Common objects
74#
75OBJCOMMON =mdb.o mdbexp.o kernel.o sym.o trace.o core.o misc.o io.o
76
77# Common source
78#
79SRCCOMMON =mdb.c mdbexp.c kernel.o sym.c trace.c core.c misc.c io.c
80
81# Object files for PC
82#
83OBJPC =$(OBJCOMMON) mdbdis86.o
84
85# Source file
86#
87SRCPC =$(SRCCOMMON) mdbdis86.c
88
89
90mdb: $(OBJPC) $(EXTRA_OBJS)
91 $(LD) $(LDFLAGS) -o mdb $(OBJPC) $(EXTRA_OBJS)
92 install -S $(STACK) mdb
93
94#
95# Dependencies for objects
96#
97mdb.o: mdb.c mdb.h $(SYSFILES) proto.h
98mdbdis86.o: mdbdis86.c mdb.h $(SYSFILES) proto.h
99mdbexp.o: mdbexp.c mdb.h $(SYSFILES) proto.h
100sym.o: sym.c mdb.h $(SYSFILES) proto.h
101trace.o: trace.c mdb.h $(PTRACE) $(SYSFILES) proto.h
102core.o: core.c mdb.h $(MMFILES) $(SYSFILES) proto.h
103misc.o: misc.c mdb.h $(SYSFILES) proto.h
104io.o: io.c mdb.h $(SYSFILES) proto.h
105
106syscalls.o: syscalls.c mdb.h $(SYSFILES) proto.h
107decode.o: decode.c mdb.h $(INCLUDE)/minix/callnr.h $(SYSFILES) proto.h
108ioctl.o: ioctl.c mdb.h $(SYSFILES) proto.h
109
110gnu_sym.o: gnu_sym.c mdb.h $(INCLUDE)/gnu/a.out.h $(SYSFILES) proto.h
111gnu_load.o: gnu_load.c $(INCLUDE)/gnu/a.out.h $(SYSFILES) proto.h
112
113$(INCLUDE)/gnu/a.out.h: a.out.h
114 install -c -o bin a.out.h $(INCLUDE)/gnu
115
116
117#
118# install
119#
120
121install: mdb
122 install -cs -o bin mdb /usr/bin
123
124install_man: mdb.1 ptrace.2
125 install -c -o bin mdb.1 /usr/man/man1
126 install -c -o bin ptrace.2 /usr/man/man2
127clean:
128 rm -f *.o mdb
129
Note: See TracBrowser for help on using the repository browser.