1
0
mirror of https://github.com/DoctorWkt/pdp7-unix.git synced 2026-01-28 04:58:08 +00:00

externalized os.mk

This commit is contained in:
Tom Everett
2016-03-25 13:24:07 -06:00
parent f0674b42e8
commit b85cf3e16d
3 changed files with 44 additions and 37 deletions

View File

@@ -1,14 +1,16 @@
include build/os.mk
all: buildit
buildit:
cd build && make all
cd build && $(MAKE) all
run: buildit
cd build && make run
cd build && $(MAKE) run
altrun: buildit
cd build && make alt && make altrun
cd build && $(MAKE) alt && $(MAKE) altrun
clean:
cd build && make clean
cd build && $(MAKE) clean

View File

@@ -1,5 +1,7 @@
# Build the kernel, the utilities, the filesystem and run SimH
include os.mk
# tools
AS=../tools/as7
ASARGS=--format=ptr
@@ -9,38 +11,6 @@ FSCK=../tools/fsck7
CCARGS=-Wno-multichar
PDP7=pdp7
# detect OS
UNAME= $(shell uname)
ifeq ($(UNAME), Linux)
UNAME= LINUX
else
ifeq ($(UNAME), Darwin)
UNAME= DARWIN
else
ifeq ($(UNAME), FreeBSD)
UNAME= FREEBSD
endif
endif
endif
# choose C compiler
ifeq ($(UNAME), LINUX)
# Linux
CC=gcc
else
ifeq ($(UNAME), FREEBSD)
# FreeBSD
CC=cc
else
ifeq ($(UNAME), DARWIN)
# Mac OS X
CC=cc
else:
$(error "Unknown OS: " $(UNAME))
endif
endif
endif
# source dirs
SYSSRC=../src/sys
CMDSRC=../src/cmd
@@ -53,7 +23,6 @@ BINDIR=bin
TESTDIR=tests
BINARIES=../binaries/
all: cmd others a.out boot.rim image.fs
# Make alternative everything: no dd but . and ..

36
build/os.mk Normal file
View File

@@ -0,0 +1,36 @@
# detect OS
UNAME=$(shell uname)
ifeq ($(UNAME), Linux)
UNAME=LINUX
MAKE=make
else
ifeq ($(UNAME), Darwin)
UNAME=DARWIN
MAKE=make
else
ifeq ($(UNAME), FreeBSD)
UNAME=FREEBSD
MAKE=gmake
endif
endif
endif
# choose C compiler
ifeq ($(UNAME), LINUX)
# Linux
CC=gcc
else
ifeq ($(UNAME), FREEBSD)
# FreeBSD
CC=cc
else
ifeq ($(UNAME), DARWIN)
# Mac OS X
CC=cc
else
$(error "Unknown OS: " $(UNAME))
endif
endif
endif