# MADT dump userland command



## rathaval (Jul 9, 2013)

I'm trying to write a Multiple APIC Description Table (MADT) dump command similar to mptable or acpidump. 

I have a problem,[ ]I am unable to build successfully using the makefiles. I get errors with respect to certain header files not being found and so on. Since I am writing a new user tool,[ ]can you suggest how I could get my makefiles to work with the headers being located while compiling?

Does anyone know of a wiki page or another forum where I can ensure I am not missing something while compiling? Thanks.


----------



## fonz (Jul 9, 2013)

What is the code you're trying to compile? Exactly how are you compiling it? What's in the Makefiles? Which header files are not being found?

Your problem description is rather vague, you'll probably have to be a lot more specific if you expect anyone to be able to help.


----------



## rathaval (Jul 9, 2013)

So I have two files in my present working directory:[]madtdump.h and madtdump.c[][.[]The Makefiles have 
	
	



```
PROG= madtdump
```
 and `SRCS= madtdump.c` which. The headers I've included are:

```
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/smp.h>
#include <vm/vm.h>
#include <vm/pmap.h>

#include <x86/apicreg.h>
#include <machine/intr_machdep.h>
#include <machine/apicvar.h>

#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/actables.h>

#include <dev/acpica/acpivar.h>
#include <dev/pci/pcivar.h>
```

When I compile, many of them are not found.[]While comparing with the Makefile of /usr/src/usr.sbin/acpi/acpidump, mine was not too different.[]In fact I had edited that Makefile to generate one for myself.[]That Makefile looks like this:

```
# $FreeBSD: release/9.1.0/usr.sbin/acpi/acpidump/Makefile 201390 2010-01-02 11:07:44Z ed $

PROG=	acpidump
MAN=	acpidump.8
SRCS=	acpi.c acpi_user.c acpidump.c

.include <bsd.prog.mk>
```

Sorry for being so vague and unclear.


----------



## fonz (Jul 14, 2013)

Sorry for the delay.

Does your Makefile also include the

```
.include <bsd.prog.mk>
```
line?


----------

