git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
edbf658
)
Usermode - Hacking up native compilation target
author
John Hodge
<
[email protected]
>
Wed, 6 Mar 2013 03:17:01 +0000
(11:17 +0800)
committer
John Hodge
<
[email protected]
>
Wed, 6 Mar 2013 03:17:01 +0000
(11:17 +0800)
BuildConf/native/Makefile.cfg
patch
|
blob
|
history
Usermode/Applications/Makefile.cfg
patch
|
blob
|
history
Usermode/Applications/Makefile.tpl
patch
|
blob
|
history
Usermode/Applications/init_src/main.c
patch
|
blob
|
history
Usermode/Libraries/Makefile.tpl
patch
|
blob
|
history
diff --git
a/BuildConf/native/Makefile.cfg
b/BuildConf/native/Makefile.cfg
index
389a738
..
aa4cd00
100644
(file)
--- a/
BuildConf/native/Makefile.cfg
+++ b/
BuildConf/native/Makefile.cfg
@@
-6,6
+6,8
@@
ARCHDIR := native
LD ?= $(CC) -print-prog-name=ld
ARCHDIR := native
LD ?= $(CC) -print-prog-name=ld
+AS = $(CC) -c
+ASSUFFIX = S
OBJDUMP := objdump -S
OBJDUMP := objdump -S
diff --git
a/Usermode/Applications/Makefile.cfg
b/Usermode/Applications/Makefile.cfg
index
5314aea
..
6b80a5e
100644
(file)
--- a/
Usermode/Applications/Makefile.cfg
+++ b/
Usermode/Applications/Makefile.cfg
@@
-4,15
+4,25
@@
# Include Usermode Makefile.cfg
include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
# Include Usermode Makefile.cfg
include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
+ifeq ($(ARCHDIR),native)
ASFLAGS = -felf
ASFLAGS = -felf
-CPPFLAGS = -ffreestanding -I$(ACESSUSERDIR)/include/ -DARCHDIR_is_$(ARCHDIR)
-CPPFLAGS += $(addprefix -I,$(wildcard $(ACESSUSERDIR)Libraries/*/include_exp/))
-CFLAGS = -fno-stack-protector $(CPPFLAGS)
+CPPFLAGS = -Wall
+CFLAGS = $(CPPFLAGS)
+LDFLAGS = -L $(OUTPUTDIR)Libs -lacess-native
+LIBGCC_PATH = $(ACESSDIR)/AcessNative/symbol_renames.ld
+else
+ASFLAGS = -felf
+CPPFLAGS = -ffreestanding
+CFLAGS = -fno-stack-protector -fno-builtin $(CPPFLAGS)
LDFLAGS = -T $(OUTPUTDIR)Libs/acess.ld -rpath-link $(OUTPUTDIR)Libs -L $(OUTPUTDIR)Libs -I /Acess/Libs/ld-acess.so -lld-acess -lc $(OUTPUTDIR)Libs/crtbegin.o $(OUTPUTDIR)Libs/crtend.o -lposix
LIBGCC_PATH = $(shell $(CC) -print-libgcc-file-name)
LDFLAGS = -T $(OUTPUTDIR)Libs/acess.ld -rpath-link $(OUTPUTDIR)Libs -L $(OUTPUTDIR)Libs -I /Acess/Libs/ld-acess.so -lld-acess -lc $(OUTPUTDIR)Libs/crtbegin.o $(OUTPUTDIR)Libs/crtend.o -lposix
LIBGCC_PATH = $(shell $(CC) -print-libgcc-file-name)
+endif
+
+CPPFLAGS += $(addprefix -I,$(wildcard $(ACESSUSERDIR)Libraries/*/include_exp/))
+CPPFLAGS += -I$(ACESSUSERDIR)/include/ -DARCHDIR_is_$(ARCHDIR)
+
# Extra-verbose errors!
# Extra-verbose errors!
-#CFLAGS += -Wall -Wextra -Wwrite-strings -Wshadow -Wswitch-default -Wswitch-enum -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wmissing-declarations -Wlogical-op
-# -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wsync-nand -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wno-endif-labels -Wshadow -Wunsafe-loop-optimizations -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-declarations -Wnormalized=nfc -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Woverlength-strings
+#CFLAGS += -Wall -Wextra -Wwrite-strings -Wshadow -Wswitch-default -Wswitch-enum -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wmissing-declarations -Wlogical-op -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wsync-nand -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wno-endif-labels -Wshadow -Wunsafe-loop-optimizations -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-declarations -Wnormalized=nfc -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Woverlength-strings
DIR = Bin
DIR = Bin
diff --git
a/Usermode/Applications/Makefile.tpl
b/Usermode/Applications/Makefile.tpl
index
5bf963b
..
f42e660
100644
(file)
--- a/
Usermode/Applications/Makefile.tpl
+++ b/
Usermode/Applications/Makefile.tpl
@@
-3,7
+3,7
@@
# - Application Template Makefile
#
# - Application Template Makefile
#
-CFLAGS += -
Wall -Werror -fno-builtin -fno-stack-protector -
g
+CFLAGS += -g
LDFLAGS += -g
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
LDFLAGS += -g
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
@@
-12,6
+12,12
@@
_OBJPREFIX := obj-$(ARCH)/
_LIBS := $(filter -l%,$(LDFLAGS))
_LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS))
_LIBS := $(filter -l%,$(LDFLAGS))
_LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS))
+ifeq ($(VERBOSE),)
+V := @
+else
+V :=
+endif
+
OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
DEPFILES := $(OBJ:%.o=%.dep)
OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
DEPFILES := $(OBJ:%.o=%.dep)
@@
-34,20
+40,21
@@
install: $(_BIN)
$(_BIN): $(OUTPUTDIR)Libs/acess.ld $(OUTPUTDIR)Libs/crt0.o $(_LIBS) $(OBJ)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $@
$(_BIN): $(OUTPUTDIR)Libs/acess.ld $(OUTPUTDIR)Libs/crt0.o $(_LIBS) $(OBJ)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $@
-ifneq ($(_DBGMAKEFILE),)
- $(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt $(LIBGCC_PATH)
-else
- @$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt $(LIBGCC_PATH)
-endif
- @$(DISASM) $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
+#ifeq ($(ARCHDIR),native)
+# $V$(LD) -g -o
[email protected]
-r $(OBJ) $(LIBGCC_PATH)
+# $V$(LD) -g $(LDFLAGS) -o $@
[email protected]
-Map $(_OBJPREFIX)Map.txt
+#else
+ $V$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt $(LIBGCC_PATH)
+#endif
+ $V$(DISASM) $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
$(OBJ): $(_OBJPREFIX)%.o: %.c
@echo [CC] -o $@
ifneq ($(_OBJPREFIX),)
@mkdir -p $(dir $@)
endif
$(OBJ): $(_OBJPREFIX)%.o: %.c
@echo [CC] -o $@
ifneq ($(_OBJPREFIX),)
@mkdir -p $(dir $@)
endif
-
@
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-
@
$(CC) -M -MP -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep
+
$V
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
$V
$(CC) -M -MP -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep
$(OUTPUTDIR)Libs/libld-acess.so:
@make -C $(ACESSDIR)/Usermode/Libraries/ld-acess.so_src/
$(OUTPUTDIR)Libs/libld-acess.so:
@make -C $(ACESSDIR)/Usermode/Libraries/ld-acess.so_src/
@@
-55,3
+62,5
@@
$(OUTPUTDIR)Libs/%:
@make -C $(ACESSDIR)/Usermode/Libraries/$*_src/
-include $(DEPFILES)
@make -C $(ACESSDIR)/Usermode/Libraries/$*_src/
-include $(DEPFILES)
+
+# vim: ft=make
diff --git
a/Usermode/Applications/init_src/main.c
b/Usermode/Applications/init_src/main.c
index
0dbbff1
..
3d96028
100644
(file)
--- a/
Usermode/Applications/init_src/main.c
+++ b/
Usermode/Applications/init_src/main.c
@@
-216,7
+216,7
@@
int ProcessInittab(const char *Path)
line_num ++;
int rv;
line_num ++;
int rv;
- if( (rv = fscanf(fp, "%64s%*[ \t]",
&
cmdbuf)) != 1 ) {
+ if( (rv = fscanf(fp, "%64s%*[ \t]", cmdbuf)) != 1 ) {
_SysDebug("fscanf rv %i != exp 1", rv);
break;
}
_SysDebug("fscanf rv %i != exp 1", rv);
break;
}
@@
-258,7
+258,7
@@
int ProcessInittab(const char *Path)
// stty <devpath> [78][NOE][012][bB]<baud> <command...>
char path_seg[32+1];
char modespec[4+6+1];
// stty <devpath> [78][NOE][012][bB]<baud> <command...>
char path_seg[32+1];
char modespec[4+6+1];
- if( fscanf(fp, "%32s %6s ",
&path_seg, &
modespec) != 2 ) {
+ if( fscanf(fp, "%32s %6s ",
path_seg,
modespec) != 2 ) {
goto lineError;
}
char **command = ReadCommand(fp);
goto lineError;
}
char **command = ReadCommand(fp);
diff --git
a/Usermode/Libraries/Makefile.tpl
b/Usermode/Libraries/Makefile.tpl
index
bc5edf8
..
7749521
100644
(file)
--- a/
Usermode/Libraries/Makefile.tpl
+++ b/
Usermode/Libraries/Makefile.tpl
@@
-15,6
+15,12
@@
OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
UTESTS := $(patsubst TEST_%.c,%,$(wildcard TEST_*.c))
DEPFILES := $(addsuffix .dep,$(OBJ))
UTESTS := $(patsubst TEST_%.c,%,$(wildcard TEST_*.c))
DEPFILES := $(addsuffix .dep,$(OBJ))
+ifeq ($(VERBOSE),1)
+V :=
+else
+V := @
+endif
+
.PHONY: all clean install postbuild
all: _libs $(_BIN) $(_XBIN)
.PHONY: all clean install postbuild
all: _libs $(_BIN) $(_XBIN)
@@
-49,10
+55,10
@@
clean:
install: all
@echo [xCP] $(DISTROOT)/Libs/$(BIN)
install: all
@echo [xCP] $(DISTROOT)/Libs/$(BIN)
-
@
$(xMKDIR) $(DISTROOT)/Libs; true
-
@
$(STRIP) $(_BIN) -o $(_BIN)_
-
@
$(xCP) $(_BIN)_ $(DISTROOT)/Libs/$(BIN)
-
@
$(RM) $(_BIN)_
+
$V
$(xMKDIR) $(DISTROOT)/Libs; true
+
$V
$(STRIP) $(_BIN) -o $(_BIN)_
+
$V
$(xCP) $(_BIN)_ $(DISTROOT)/Libs/$(BIN)
+
$V
$(RM) $(_BIN)_
ifneq ($(_XBIN),)
$(xCP) $(_XBIN) $(DISTROOT)/Libs/
endif
ifneq ($(_XBIN),)
$(xCP) $(_XBIN) $(DISTROOT)/Libs/
endif
@@
-63,23
+69,22
@@
endif
$(_BIN): $(OBJ) $(_LIBS)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $(BIN) $(OBJ)
$(_BIN): $(OBJ) $(_LIBS)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $(BIN) $(OBJ)
-
@
$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)
-
@
$(DISASM) -D -S $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
+
$V
$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)
+
$V
$(DISASM) -D -S $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
$(_OBJPREFIX)%.o: %.c
@echo [CC] -o $@
@mkdir -p $(dir $@)
$(_OBJPREFIX)%.o: %.c
@echo [CC] -o $@
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
- @$(CC) -M -MP -MT $@ $(CPPFLAGS) $< -o
[email protected]
+ $V$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< -MMD -MP -MT $@ -MF
[email protected]
$(_OBJPREFIX)%.ao: %.$(ASSUFFIX)
@echo [AS] -o $@
@mkdir -p $(dir $@)
$(_OBJPREFIX)%.ao: %.$(ASSUFFIX)
@echo [AS] -o $@
@mkdir -p $(dir $@)
-
@
$(AS) $(ASFLAGS) -o $@ $<
+
$V
$(AS) $(ASFLAGS) -o $@ $<
ifeq ($(ASSUFFIX),S)
ifeq ($(ASSUFFIX),S)
-
@
$(AS) $(ASFLAGS) -o
[email protected]
$< -M
+
$V
$(AS) $(ASFLAGS) -o
[email protected]
$< -M
else
else
-
@
$(AS) $(ASFLAGS) -o $@ $< -M >
[email protected]
+
$V
$(AS) $(ASFLAGS) -o $@ $< -M >
[email protected]
endif
#$(OUTPUTDIR)Libs/libld-acess.so:
endif
#$(OUTPUTDIR)Libs/libld-acess.so:
UCC
git Repository :: git.ucc.asn.au