2005-08-04 10:44:16 +02:00
|
|
|
#
|
|
|
|
# Makefile for mdb
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Edit as indicated below.
|
|
|
|
#
|
|
|
|
USR =/usr
|
|
|
|
#
|
|
|
|
# (1) For Compiler and target system:
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# For ANSI C and Minix 1.7.x 32-bit
|
|
|
|
#
|
2005-08-22 13:17:47 +02:00
|
|
|
CC =exec cc
|
2005-08-04 10:44:16 +02:00
|
|
|
LD =exec cc
|
|
|
|
LDFLAGS =-i
|
|
|
|
TARGET =mdb
|
2006-03-15 12:29:22 +01:00
|
|
|
STACK =200000
|
2005-08-04 10:44:16 +02:00
|
|
|
#
|
|
|
|
# (2) If kernel and mm are not in "/usr/src" change this
|
|
|
|
#
|
2010-04-29 22:05:01 +02:00
|
|
|
SYSTEM =../..
|
2005-08-04 10:44:16 +02:00
|
|
|
#
|
|
|
|
# (3) Select Options
|
|
|
|
#
|
|
|
|
# i) For GNU_EXEC Support, uncomment:
|
|
|
|
#
|
2009-12-29 22:38:26 +01:00
|
|
|
FOR_GNU =gnu_sym.o
|
|
|
|
DEF_GNU =-DGNU_SUPPORT
|
2005-08-04 10:44:16 +02:00
|
|
|
#
|
|
|
|
# ii) For tracing of syscalls, uncomment:
|
|
|
|
#
|
|
|
|
#FOR_SYSCALLS =syscalls.o decode.o ioctl.o
|
|
|
|
#DEF_SYSCALLS =-DSYSCALLS_SUPPORT
|
|
|
|
#
|
|
|
|
# iii) For no debugging of mdb, uncomment:
|
|
|
|
#
|
|
|
|
#DEF_DEBUG =-DNDEBUG
|
|
|
|
|
|
|
|
EXTRA_OBJS =$(FOR_GNU) $(FOR_SYSCALLS)
|
|
|
|
EXTRA_DEFS =$(DEF_GNU) $(DEF_SYSCALLS) $(DEF_DEBUG)
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
CFLAGS =-I$(SYSTEM) -I$(SYSTEM)/servers -I$(INCLUDE) -D_MINIX -D_POSIX_SOURCE $(EXTRA_DEFS)
|
|
|
|
|
|
|
|
# For various included files or system files
|
|
|
|
#
|
|
|
|
INCLUDE =$(USR)/include
|
|
|
|
KERNEL =$(SYSTEM)/kernel
|
|
|
|
PTRACE =$(INCLUDE)/sys/ptrace.h
|
|
|
|
|
|
|
|
|
|
|
|
# Header files from system and kernel in "mdb.h"
|
|
|
|
#
|
|
|
|
SYSFILES= $(INCLUDE)/minix/config.h \
|
|
|
|
$(INCLUDE)/minix/const.h \
|
|
|
|
$(INCLUDE)/ansi.h \
|
|
|
|
$(INCLUDE)/minix/type.h \
|
|
|
|
$(INCLUDE)/limits.h \
|
|
|
|
$(INCLUDE)/errno.h \
|
|
|
|
$(INCLUDE)/sys/types.h \
|
|
|
|
$(KERNEL)/const.h \
|
|
|
|
$(KERNEL)/type.h \
|
|
|
|
$(KERNEL)/proc.h
|
|
|
|
|
|
|
|
# Common objects
|
|
|
|
#
|
|
|
|
OBJCOMMON =mdb.o mdbexp.o kernel.o sym.o trace.o core.o misc.o io.o
|
|
|
|
|
|
|
|
# Common source
|
|
|
|
#
|
|
|
|
SRCCOMMON =mdb.c mdbexp.c kernel.o sym.c trace.c core.c misc.c io.c
|
|
|
|
|
|
|
|
# Object files for PC
|
|
|
|
#
|
|
|
|
OBJPC =$(OBJCOMMON) mdbdis86.o
|
|
|
|
|
|
|
|
# Source file
|
|
|
|
#
|
|
|
|
SRCPC =$(SRCCOMMON) mdbdis86.c
|
|
|
|
|
|
|
|
|
|
|
|
mdb: $(OBJPC) $(EXTRA_OBJS)
|
|
|
|
$(LD) $(LDFLAGS) -o mdb $(OBJPC) $(EXTRA_OBJS)
|
|
|
|
install -S $(STACK) mdb
|
|
|
|
|
|
|
|
#
|
|
|
|
# Dependencies for objects
|
|
|
|
#
|
2005-08-05 13:56:47 +02:00
|
|
|
mdb.o: mdb.c mdb.h $(SYSFILES) proto.h
|
|
|
|
mdbdis86.o: mdbdis86.c mdb.h $(SYSFILES) proto.h
|
|
|
|
mdbexp.o: mdbexp.c mdb.h $(SYSFILES) proto.h
|
|
|
|
sym.o: sym.c mdb.h $(SYSFILES) proto.h
|
|
|
|
trace.o: trace.c mdb.h $(PTRACE) $(SYSFILES) proto.h
|
|
|
|
core.o: core.c mdb.h $(MMFILES) $(SYSFILES) proto.h
|
|
|
|
misc.o: misc.c mdb.h $(SYSFILES) proto.h
|
|
|
|
io.o: io.c mdb.h $(SYSFILES) proto.h
|
|
|
|
|
|
|
|
syscalls.o: syscalls.c mdb.h $(SYSFILES) proto.h
|
|
|
|
decode.o: decode.c mdb.h $(INCLUDE)/minix/callnr.h $(SYSFILES) proto.h
|
|
|
|
ioctl.o: ioctl.c mdb.h $(SYSFILES) proto.h
|
|
|
|
|
2009-12-29 22:38:26 +01:00
|
|
|
gnu_sym.o: gnu_sym.c mdb.h $(SYSFILES) proto.h
|
2005-08-04 10:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# install
|
|
|
|
#
|
|
|
|
|
|
|
|
install: mdb
|
2005-08-26 15:02:26 +02:00
|
|
|
install -cs -o bin mdb /usr/bin
|
2005-08-04 10:44:16 +02:00
|
|
|
|
2009-12-29 22:38:26 +01:00
|
|
|
install_man: mdb.1
|
2005-08-04 10:44:16 +02:00
|
|
|
install -c -o bin mdb.1 /usr/man/man1
|
2009-12-29 22:38:26 +01:00
|
|
|
|
2005-08-04 10:44:16 +02:00
|
|
|
clean:
|
|
|
|
rm -f *.o mdb
|
|
|
|
|