mirror of
https://github.com/DoctorWkt/pdp7-unix.git
synced 2026-05-05 07:33:37 +00:00
externalized os.mk
This commit is contained in:
10
Makefile
10
Makefile
@@ -1,14 +1,16 @@
|
|||||||
|
|
||||||
|
include build/os.mk
|
||||||
|
|
||||||
all: buildit
|
all: buildit
|
||||||
|
|
||||||
buildit:
|
buildit:
|
||||||
cd build && make all
|
cd build && $(MAKE) all
|
||||||
|
|
||||||
run: buildit
|
run: buildit
|
||||||
cd build && make run
|
cd build && $(MAKE) run
|
||||||
|
|
||||||
altrun: buildit
|
altrun: buildit
|
||||||
cd build && make alt && make altrun
|
cd build && $(MAKE) alt && $(MAKE) altrun
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd build && make clean
|
cd build && $(MAKE) clean
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Build the kernel, the utilities, the filesystem and run SimH
|
# Build the kernel, the utilities, the filesystem and run SimH
|
||||||
|
|
||||||
|
include os.mk
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
AS=../tools/as7
|
AS=../tools/as7
|
||||||
ASARGS=--format=ptr
|
ASARGS=--format=ptr
|
||||||
@@ -9,38 +11,6 @@ FSCK=../tools/fsck7
|
|||||||
CCARGS=-Wno-multichar
|
CCARGS=-Wno-multichar
|
||||||
PDP7=pdp7
|
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
|
# source dirs
|
||||||
SYSSRC=../src/sys
|
SYSSRC=../src/sys
|
||||||
CMDSRC=../src/cmd
|
CMDSRC=../src/cmd
|
||||||
@@ -53,7 +23,6 @@ BINDIR=bin
|
|||||||
TESTDIR=tests
|
TESTDIR=tests
|
||||||
BINARIES=../binaries/
|
BINARIES=../binaries/
|
||||||
|
|
||||||
|
|
||||||
all: cmd others a.out boot.rim image.fs
|
all: cmd others a.out boot.rim image.fs
|
||||||
|
|
||||||
# Make alternative everything: no dd but . and ..
|
# Make alternative everything: no dd but . and ..
|
||||||
|
|||||||
36
build/os.mk
Normal file
36
build/os.mk
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user