-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from ken4647/dev
add hello_world example for cpp
- Loading branch information
Showing
7 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
ARCH ?= x86_64 | ||
C_COMPILER := $(shell which $(CC)) | ||
CXX_COMPILER := $(shell which $(CC)) | ||
AR := $(shell which $(AR)) | ||
RANLIB := $(shell which $(RANLIB)) | ||
CROSS_COMPILE_PATH := $(shell dirname $(C_COMPILER))/.. | ||
|
||
app-objs := main.o | ||
|
||
$(APP)/$(app-objs): $(APP)/axbuild.mk | ||
$(CXX_COMPILER) -c -o $(app-objs) $(APP)/main.cpp | ||
$(LD) -o $(app-objs) -nostdlib -static -no-pie -r -e main \ | ||
$(app-objs) \ | ||
$(CROSS_COMPILE_PATH)/*-linux-musl/lib/libstdc++.a \ | ||
$(CROSS_COMPILE_PATH)/lib/gcc/*-linux-musl/*/libgcc_eh.a | ||
|
||
clean_c:: | ||
rm -rf $(APP)/$(app-objs) | ||
|
||
.PHONY: $(APP)/$(app-objs) clean_c |
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,6 @@ | ||
alloc | ||
paging | ||
irq | ||
multitask | ||
fs | ||
random-hw |
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,12 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
// This is a dummy function to avoid linker errors as this example should be a static executable. | ||
void* __dso_handle = NULL; | ||
|
||
int main(int argc, char* argv[]) { | ||
cout << "Hello, wolrd!" << endl; | ||
return 0; | ||
} | ||
|