summaryrefslogtreecommitdiff
path: root/Makeconf
blob: 392814a704aceaaf9c8def67dfcaf4209d1a6fc6 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Generic configuration for Hurd compilation

all:

# 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

# This is the directory containing the top-level Hurd source (and this file).
hurdsource := /home/hm1/gnu/hurd

# This is the directory holding ar and ranlib
bindir := /usr/local/i386-mach/bin

# This is a machine on which to run MiG.  (MiG writes CPU dependent code,
# so MiG has to be run on a machine that's the same as the one that will 
# run the eventual code.)  If you are not doing cross-compilation, then
# you need to set MIGCOM and MIG below to the plain pathnames of those
# two programs respectively.
mighost := ernst

# Set these options to the GCC compiler spec (the correct value
# can be found in /usr/local/lib/lib-gcc).
CCTARGET=i386-mach
CCVERSION=current
CCTYPE=-b $(CCTARGET) -V $(CCVERSION)

# 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
libports := $(hurdinst)/lib/libports.a
libioserver := $(hurdinst)/lib/libioserver.a
libpager := $(hurdinst)/lib/libpager.a
libfshelp := $(hurdinst)/lib/libfshelp.a
libdiskfs := $(hurdinst)/lib/libdiskfs.a
gccheaders := /usr/local/lib/gcc-lib/$(CCTARGET)/$(CCVERSION)/include

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

# Finding binaries
CC=gcc $(CCTYPE)
MIGCOM=rsh $(mighost) cd $(hurdsource)/$(dir) \; /usr/local/lib/migcom 
CPP=/usr/local/lib/gcc-lib/$(CCTARGET)/$(CCVERSION)/cpp
MIG=rsh $(mighost) cd $(hurdsource)/$(dir) \; mig
AR=$(bindir)/ar
RANLIB=$(bindir)/ranlib

# 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) \
$(OBJS) $(LIBS) $(libthreads) $(libc) -lgcc
endef

# Making a snapshot

lndist: $(DIST_FILES) $(hurdsource)/hurd-snap/$(dir)
	ln $(DIST_FILES) $(hurdsource)/hurd-snap/$(dir)

ifeq ($(dir),.)
$(hurdsource)/hurd-snap/$(dir):
else
$(hurdsource)/hurd-snap/$(dir):
	mkdir $(hurdsource)/hurd-snap/$(dir)
endif


# Dependencies for building libraries

ifneq ($(strip $(dir)),libports)
$(libports): FORCE
	$(MAKE) -C $(hurdsource)/libports $(libports)
$(headers)/hurd/ports.h: FORCE
	$(MAKE) -C $(hurdsource)/libports $(headers)/hurd/ports.h
endif

ifneq ($(strip $(dir)),libioserver)
$(libioserver): FORCE
	$(MAKE) -C $(hurdsource)/libioserver $(libioserver)
$(headers)/hurd/ioserver.h: FORCE
	$(MAKE) -C $(hurdsource)/libioserver $(headers)/hurd/ioserver.h
endif

ifneq ($(strip $(dir)),libpager)
$(libpager): FORCE
	$(MAKE) -C $(hurdsource)/libpager $(libpager)
$(headers)/hurd/pager.h: FORCE
	$(MAKE) -C $(hurdsource)/libpager $(headers)/hurd/pager.h
endif

ifneq ($(strip $(dir)),libdiskfs)
$(libdiskfs): FORCE
	$(MAKE) -C $(hurdsource)/libdiskfs $(libdiskfs)
$(headers)/hurd/diskfs.h: FORCE
	$(MAKE) -C $(hurdsource)/libdiskfs $(headers)/hurd/diskfs.h
endif

ifneq ($(strip $(dir)),libfshelp)
$(libfshelp): FORCE
	$(MAKE) -C $(hurdsource)/libfshelp $(libfshelp)
$(headers)/hurd/fshelp.h: FORCE
	$(MAKE) -C $(hurdsource)/libfshelp $(headers)/hurd/fshelp.h
endif

FORCE: