File tree 4 files changed +59
-0
lines changed
4 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ install: boost
35
35
cp README.md ${PREFIX}/
36
36
cp README_MORPHOS.md ${PREFIX}/
37
37
cp LICENSE_1_0.txt ${PREFIX}/
38
+ cp -r examples_mos ${PREFIX}/
38
39
39
40
40
41
package: install
Original file line number Diff line number Diff line change
1
+ CC=/gg/bin/ppc-morphos-gcc-11
2
+ CXX=/gg/bin/ppc-morphos-g++-11
3
+
4
+ C_FLAGS=-Ofast -noixemul -mcpu=G4 -maltivec -mabi=altivec -DNDEBUG -D__MORPHOS__
5
+ CXX_FLAGS=-std=c++17
6
+
7
+ LD_FLAGS=-L/tmp/boost-1.87.0-morphos-ppc/lib -lboost_filesystem
8
+ INCLUDES=-I/tmp/boost-1.87.0-morphos-ppc/include
9
+
10
+ all: example-filesystem-cpp17 example-filesystem-boost
11
+
12
+ #--- build example-filesystem-boost: ---#
13
+ example-filesystem-boost: example-filesystem-boost.cpp
14
+ $(CXX) -o ${@} $(^) ${C_FLAGS} ${CXX_FLAGS} ${INCLUDES} ${LD_FLAGS}
15
+
16
+ #--- build example-filesystem-cpp17: ---#
17
+ example-filesystem-cpp17: example-filesystem-cpp17.cpp
18
+ $(CXX) -o ${@} $(^) ${C_FLAGS} ${CXX_FLAGS}
19
+
20
+ #--- clean ---#
21
+ .PHONY: clean
22
+ clean:
23
+ rm -f example-filesystem-boost
24
+ rm -f example-filesystem-cpp17
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < boost/filesystem.hpp>
3
+
4
+ int main (int argc, char *argv[]) {
5
+ if (argc < 2 ) {
6
+ std::cout << " Usage: " << argv[0 ] << " <path> " << std::endl;
7
+ return 1 ;
8
+ }
9
+ const boost::filesystem::path p{argv[1 ]};
10
+ if (boost::filesystem::exists (p)) {
11
+ std::cout << p.string () << " size: " << boost::filesystem::file_size (p) << " kb" << std::endl;
12
+ } else {
13
+ std::cout << p.string () << " does not exists!" << boost::filesystem::file_size (p) << std::endl;
14
+ }
15
+
16
+ return 0 ;
17
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < filesystem>
3
+
4
+ int main (int argc, char *argv[]) {
5
+ if (argc < 2 ) {
6
+ std::cout << " Usage: " << argv[0 ] << " <path> " << std::endl;
7
+ return 1 ;
8
+ }
9
+ const std::filesystem::path p{argv[1 ]};
10
+ if (std::filesystem::exists (p)) {
11
+ std::cout << p.string () << " size: " << std::filesystem::file_size (p) << " kb" << std::endl;
12
+ } else {
13
+ std::cout << p.string () << " does not exists!" << std::filesystem::file_size (p) << std::endl;
14
+ }
15
+
16
+ return 0 ;
17
+ }
You can’t perform that action at this time.
0 commit comments