From 3834bc793857aae02198d8f4c8a8373957269678 Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Thu, 26 Aug 2021 08:18:35 +0100 Subject: Added emcc compilation --- Build/Makefile | 7 ++++++- NaiveFFT/main.c | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Build/Makefile b/Build/Makefile index 8b31c12..e19df12 100644 --- a/Build/Makefile +++ b/Build/Makefile @@ -1,12 +1,17 @@ - +EMCC=emcc CC=gcc SOURCEDIR=../NaiveFFT LDFLAGS=-lm +EM_LDFALGS=-s LLD_REPORT_UNDEFINED + make: $(CC) -c $(SOURCEDIR)/main.c -g3 $(CC) main.o -o NaiveFFT $(LDFLAGS) +emcc: + $(EMCC) $(SOURCEDIR)/main.c ../NaiveFFT/fft.c -s WASM=1 -O3 -o index.js $(EM_LDFALGS) -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' + web: darkhttpd ./ --port 12345 diff --git a/NaiveFFT/main.c b/NaiveFFT/main.c index 718e5d0..036bb79 100644 --- a/NaiveFFT/main.c +++ b/NaiveFFT/main.c @@ -42,6 +42,7 @@ int main(int argc, const char * argv[]) { ffti_shuffle_1(data_i, data_q, DATA_SIZE); fft_1(data_i, data_q, DATA_SIZE, 0); + //run dft by default //dft(data_i, data_q, DATA_SIZE,0); printf("after FFT\n"); @@ -83,7 +84,6 @@ int main(int argc, const char * argv[]) { free(d_q); d_q = NULL; } - { time_t timer; char buffer[32]; @@ -94,7 +94,6 @@ int main(int argc, const char * argv[]) { strftime(buffer, 32, "%H:%M:%S", tm_info); puts(buffer); - } return 0; } -- cgit v1.2.3