# Generic configuration for Hurd compilation all: # This is the directory into which Hurd cross-building tools are placed hurdinst := /home/gd3/hurdinst # This is the directory which serves as root for the Hurd. hostname := $(shell hostname) hurdroot-douglas.gnu.ai.mit.edu = /home/hm2/hurdroot hurdroot-ernst.gnu.ai.mit.edu = /home/hm1/hurdroot hurdroot := $(hurdroot-$(hostname)) # This is the device with the filesystem mounted as $(hurdroot) hurdrootdev := /dev/hd0f # This is the directory containing the top-level Hurd source (and this file). hurdsource := /home/gd3/gnu/hurd # Where to find various things for compilation: headers := $(hurdinst)/include startup := $(hurdinst)/lib/crt0.o libc := $(patsubst %,$(hurdinst)/lib/lib%.a,c machuser hurduser c hurduser) 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 malloc := $(hurdinst)/lib/malloc.o # Finding binaries include $(hurdsource)/Maketools gccheaders = /usr/local/lib/gcc-lib/$(CCTARGET)/$(CCVERSION)/include libgcc := /usr/local/lib/gcc-lib/$(CCTARGET)/$(CCVERSION)/libgcc.a # Flags for compilation CPPFLAGS := -nostdinc -I$(headers) -I$(gccheaders) CFLAGS := -Wall -Wno-parentheses -g # How to do some things: ldflags = $(addprefix -Xlinker ,$(LDFLAGS)) define link $(LD) -e __start $(LDFLAGS) -o $@ $(startup) \ $(OBJS) $(LIBS) $(malloc) $(libc) $(libgcc) endef # Mounting $(hurdroot) ifeq ($(hurdroot),) $(hurdroot): force @echo Cannot do install on this machine. false else $(hurdroot): $(hurdroot)/mounted $(hurdroot)/mounted: fsck -p $(hurdrootdev) mount $(hurdrootdev) endif # Making a snapshot lndist: $(DIST_FILES) $(hurdsource)/hurd-snap/$(dir) FORCE 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 ifneq ($(strip $(dir)),libthreads) $(libthreads): FORCE $(MAKE) -C $(hurdsource)/libthreads $(libthreads) $(headers)/cthreads.h: FORCE $(MAKE) -C $(hurdsource)/libthreads $(headers)/cthreads.h $(headers)/machine/cthreads.h: FORCE $(MAKE) -C $(hurdsource)/libthreads $(headers)/machine/cthreads.h endif FORCE: