summaryrefslogtreecommitdiff
path: root/Makeconf
blob: aaf343f6b88d909e8681f3598b098af1a98cdb58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Generic configuration for Hurd compilation

# This is the directory into which Hurd cross-building tools are placed
hurdinst := /home/hm1/hurdinst

# This is the directory which serves as root for the Hurd.
hurdroot := /home/hm1/hurdroot

# Where to find various things for compilation:
headers := $(hurdinst)/include
startup := $(hurdinst)/lib/crt0.o
libc := $(hurdinst)/lib/libc.a
libthreads := $(hurdinst)/lib/libthreads.a
gccheaders := /usr/local/lib/gcc-lib/i386-compaq-mach/2.4.5/include

# Flags for compilation
CPPFLAGS := -nostdinc -I$(headers) -I$(gccheaders)
CFLAGS := -Wall -Wno-parentheses -O -g

# Finding binaries
CC=gcc
MIGCOM=/usr/local/lib/migcom
CPP=/usr/local/lib/gcc-lib/i386-compaq-mach/2.4.5/cpp
MIG=mig

# How to do some things:

ldflags = $(addprefix -Xlinker ,$(LDFLAGS)) 

# $(link) uses threads to get malloc until the one in the library is fixed.

define link
$(CC) -nostdlib -e__start $(ldflags) -o $@ $(CFLAGS) $(startup) \
$^ $(libthreads) $(libc) -lgcc
endef

define link-with-threads
$(CC) -nostdlib -e__start $(ldflags) -o $@ $(CFLAGS) $(startup) \
$^ $(libthreads) $(libc) -lgcc
endef