|
1 | 1 |
|
2 | 2 | include lib/Makefile.smol |
3 | 3 |
|
4 | | -all: libsmol.a main |
| 4 | +all: libsmol cppmain |
5 | 5 |
|
6 | | -libsmol.a: smol.chpl |
7 | | - chpl --library --library-makefile --library-cmakelists smol.chpl |
| 6 | +# chpl --library --library-makefile --library-cmakelists smol.chpl |
8 | 7 |
|
9 | | -main: main.c libsmol.a |
| 8 | +libsmol: smol.chpl |
| 9 | + chpl \ |
| 10 | + --library \ |
| 11 | + --dynamic \ |
| 12 | + --library-dir lib \ |
| 13 | + --savec lib/savec \ |
| 14 | + --library-makefile \ |
| 15 | + --library-cmakelists \ |
| 16 | + --no-munge-with-ids \ |
| 17 | + smol.chpl |
| 18 | + |
| 19 | +cmain: main.c |
10 | 20 | $(CHPL_COMPILER) $(CHPL_CFLAGS) -o main main.c $(CHPL_LDFLAGS) |
11 | 21 |
|
| 22 | + |
| 23 | + |
| 24 | +CPP_CFLAGS = \ |
| 25 | + -Ilib \ |
| 26 | + -Wno-unused \ |
| 27 | + -Wno-uninitialized \ |
| 28 | + -Wno-pointer-sign \ |
| 29 | + -Wno-incompatible-pointer-types \ |
| 30 | + -Wno-tautological-compare \ |
| 31 | + -I/opt/homebrew/Cellar/chapel/2.4.0_1/libexec/modules/internal \ |
| 32 | + -I$(CHPL_RUNTIME_INCL)/localeModels/flat \ |
| 33 | + -I$(CHPL_RUNTIME_INCL)/localeModels \ |
| 34 | + -I$(CHPL_RUNTIME_INCL)/comm/none \ |
| 35 | + -I$(CHPL_RUNTIME_INCL)/comm \ |
| 36 | + -I$(CHPL_RUNTIME_INCL)/tasks/qthreads \ |
| 37 | + -I$(CHPL_RUNTIME_INCL)/. \ |
| 38 | + -I$(CHPL_RUNTIME_INCL)/./qio \ |
| 39 | + -I$(CHPL_RUNTIME_INCL)/./atomics/cstdlib \ |
| 40 | + -I$(CHPL_RUNTIME_INCL)/./mem/jemalloc \ |
| 41 | + -I$(CHPL_THIRD_PARTY)/utf8-decoder \ |
| 42 | + -I$(CHPL_THIRD_PARTY)/qthread/install/darwin-arm64-native-llvm-none-flat-jemalloc-system/include \ |
| 43 | + -Wno-error=unused-variable \ |
| 44 | + -I$(CHPL_THIRD_PARTY)/re2/install/darwin-arm64-native-llvm-none/include \ |
| 45 | + -I. -I/opt/homebrew/Cellar/gmp/6.3.0/include \ |
| 46 | + -I/opt/homebrew/Cellar/hwloc/2.12.0/include \ |
| 47 | + -I/opt/homebrew/Cellar/jemalloc/5.3.0/include \ |
| 48 | + -I/opt/homebrew/include |
| 49 | + |
| 50 | +CPP_LDFLAGS = -Llib -lsmol -L$(CHPL_RUNTIME_LIB)/darwin/llvm/arm64/cpu-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc-system/re2-bundled/fs-none/lib_pic-none/san-none -lchpl -L$(CHPL_THIRD_PARTY)/qthread/install/darwin-arm64-native-llvm-none-flat-jemalloc-system/lib -Wl,-rpath,$(CHPL_THIRD_PARTY)/qthread/install/darwin-arm64-native-llvm-none-flat-jemalloc-system/lib -lqthread -L/opt/homebrew/Cellar/hwloc/2.12.0/lib -L$(CHPL_THIRD_PARTY)/re2/install/darwin-arm64-native-llvm-none/lib -lre2 -Wl,-rpath,$(CHPL_THIRD_PARTY)/re2/install/darwin-arm64-native-llvm-none/lib -lm -lpthread -L/opt/homebrew/Cellar/gmp/6.3.0/lib -lgmp -L/opt/homebrew/Cellar/hwloc/2.12.0/lib -Wl,-rpath,/opt/homebrew/Cellar/hwloc/2.12.0/lib -lhwloc -L/opt/homebrew/Cellar/jemalloc/5.3.0/lib -Wl,-rpath,/opt/homebrew/Cellar/jemalloc/5.3.0/lib -ljemalloc -L/opt/homebrew/lib |
| 51 | + |
| 52 | +# $(CHPL_LINKER) $(CHPL_CFLAGS) -o main main.cpp $(CHPL_LDFLAGS) |
| 53 | + |
| 54 | +maincpp.o: main.cpp |
| 55 | + $(CHPL_COMPILER) $(CHPL_CFLAGS) -fPIC main.cpp -o maincpp.o $(CHPL_LDFLAGS) |
| 56 | + $(CHPL_COMPILER) $(CHPL_CFLAGS) -fPIC main.cpp -o maincpp $(CHPL_LDFLAGS) |
| 57 | + |
| 58 | +maincpp: maincpp.o |
| 59 | + $(CHPL_LINKER) -o maincpp maincpp.o |
| 60 | +#$(CHPL_LINKER) $(CHPL_CFLAGS) -o main main.o $(CHPL_LDFLAGS) |
| 61 | + |
12 | 62 | clean: |
13 | | - rm -f main lib/libsmol.a |
| 63 | + rm -f maincpp maincpp.o main.o |
| 64 | +# rm -f main lib/libsmol.a |
0 commit comments