-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc,c86] Compile all of ELKS C library with C86
- Loading branch information
Showing
28 changed files
with
1,945 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ libc.lst | |
build-ml/ | ||
*.obj | ||
*.lib | ||
*.ocj | ||
*.as | ||
*.i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Makefile include for C86 build | ||
|
||
ifeq "$(TOPDIR)" "" | ||
$(error TOPDIR environment variable not set) | ||
endif | ||
|
||
ifeq "$(C86)" "" | ||
$(error C86 environment variable not set) | ||
endif | ||
|
||
INCLUDES = -I$(TOPDIR)/libc/include -I$(TOPDIR)/elks/include | ||
INCLUDES += -I$(C86)/libc/include | ||
DEFINES = -D__LIBC__ -D__HAS_NO_FLOATS__=1 -D__HAS_NO_LONGLONG__ | ||
LIBOBJS=$(OBJS:.o=.ocj) | ||
|
||
CPP86FLAGS=\ | ||
-0 \ | ||
|
||
C86FLAGS =\ | ||
-g \ | ||
-v \ | ||
-O \ | ||
-bas86 \ | ||
-warn=4 \ | ||
-lang=c99 \ | ||
-align=yes \ | ||
-separate=yes \ | ||
-stackopt=minimum \ | ||
-peep=all \ | ||
-stackcheck=no \ | ||
|
||
AS86FLAGS =\ | ||
-0 \ | ||
-O \ | ||
-j \ | ||
-w- \ | ||
|
||
CPP=cpp86 | ||
CC=c86 | ||
AR=ar86 | ||
AS=as86 | ||
|
||
CPPFLAGS=$(CPP86FLAGS) $(INCLUDES) $(DEFINES) | ||
CFLAGS=$(C86FLAGS) | ||
ASFLAGS=$(AS86FLAGS) | ||
ARFLAGS_SUB=r | ||
|
||
%.i: %.c | ||
$(CPP) $(CPPFLAGS) -o $*.i $< | ||
|
||
%.as: %.i | ||
$(CC) $(CFLAGS) $< $*.as | ||
|
||
%.ocj: %.as | ||
cp $*.as /tmp | ||
$(AS) $(ASFLAGS) -o $*.ocj $*.as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# C86 Makefile for ELKS C Library | ||
|
||
include c86.inc | ||
|
||
#NOTBUILT = \ | ||
asm \ | ||
debug \ | ||
gcc \ | ||
math \ | ||
crt0.S \ | ||
SUBDIRS = \ | ||
c86 \ | ||
ctype \ | ||
error \ | ||
getent \ | ||
malloc \ | ||
misc \ | ||
net \ | ||
regex \ | ||
stdio \ | ||
string \ | ||
termcap \ | ||
termios \ | ||
time \ | ||
# end of list | ||
|
||
.PHONY: all | ||
all: | ||
$(MAKE) -C system -f out.mk COMPILER=c86 LIB=out.lib | ||
for DIR in $(SUBDIRS); do $(MAKE) -C $$DIR COMPILER=c86 LIB=out.lib || exit 1; done | ||
$(AR) $(ARFLAGS_SUB) libc86.a */*.lib | ||
cp libc86.a $(TOPDIR)/elkscmd/rootfs_template/root | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f */*.i */*.as */*.ocj */*.lst */*.lib | ||
for DIR in $(SUBDIRS); do rm -f $$DIR/*.ocj $$DIR/*.lib || exit 1; done | ||
rm -f libc86.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Makefile of libc/c86 module | ||
|
||
COMPILER ?= c86 | ||
LIB ?= out.lib | ||
|
||
include $(TOPDIR)/libc/$(COMPILER).inc | ||
|
||
OBJS = $(patsubst %.s,%.ocj,$(wildcard *.s)) | ||
|
||
all: $(LIB) | ||
|
||
$(LIB): $(LIBOBJS) | ||
$(RM) $@ | ||
$(AR) $(ARFLAGS_SUB) $@ $(LIBOBJS) | ||
|
||
%.ocj: %.s | ||
$(AS) $(ASFLAGS) -o $@ -l $*.lst $^ | ||
|
||
|
||
clean: | ||
$(RM) *.ocj *.lib *.lst |
Oops, something went wrong.