aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathansmith <nathansmith@posteo.com>2025-04-26 14:49:59 +0000
committernathansmith <nathansmith@posteo.com>2025-04-26 14:49:59 +0000
commitcbc1dfa2fcafb283cea5d87092db1a9b786c962c (patch)
tree969a12b9d37f4bda2aed8a984fe2ac96d0c55d6f
parentc2cf22bbfb26f0f778ded8be82ddb16816b8c8f0 (diff)
downloadsldj-cbc1dfa2fcafb283cea5d87092db1a9b786c962c.tar.gz
sldj-cbc1dfa2fcafb283cea5d87092db1a9b786c962c.tar.bz2
sldj-cbc1dfa2fcafb283cea5d87092db1a9b786c962c.zip
Downgraded to makefile lol
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt25
-rw-r--r--Makefile6
-rw-r--r--README.md7
-rw-r--r--src/Makefile18
-rw-r--r--src/ffmpeg.c2
-rw-r--r--src/ffmpeg.h10
-rw-r--r--src/libsldj/Makefile11
-rw-r--r--src/libsldj/util.c2
-rw-r--r--src/libsldj/util.h (renamed from include/libsldj/util.h)0
-rw-r--r--src/scripting.c4
11 files changed, 58 insertions, 30 deletions
diff --git a/.gitignore b/.gitignore
index 9785597..b25c15b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-build
-.cache
+*~
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 285d158..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-cmake_minimum_required(VERSION 3.30.5)
-
-project(sldj VERSION 1.0)
-
-find_package(raylib 3.0 REQUIRED)
-
-set(C_STANDARD 99)
-set(C_STANDARD_REQUIRED ON)
-set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-
-file(GLOB SRC_FILES src/*.c src/libsldj/*.c)
-
-# Build exe file.
-add_executable(${PROJECT_NAME} ${SRC_FILES})
-
-target_include_directories(${PROJECT_NAME} PUBLIC include src)
-target_link_libraries(${PROJECT_NAME} raylib m tcc)
-
-# Build libsldj.
-file(GLOB LIBSLDJ_SRC_FILES src/libsldj/*.c)
-add_library(libsldj SHARED ${LIBSLDJ_SRC_FILES})
-target_include_directories(libsldj PUBLIC include)
-
-file(COPY include/libsldj DESTINATION ${CMAKE_BINARY_DIR})
-
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..241525f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+all:
+ @make -C src
+clean:
+ @make -C src clean
+%:
+ @make -C src $@
diff --git a/README.md b/README.md
index 47255c3..db39e7a 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,9 @@
# Scanline DJ
Fun little project for making cool videos
+
+# Libraries
+- [raylib](https://www.raylib.com)
+- [tinycc](https://bellard.org/tcc)
+
+# References
+- [musializer](https://github.com/tsoding/musializer)
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..7b5f86e
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,18 @@
+CFLAGS = -Isrc -I../include
+LDFLAGS = -lm -lraylib -ltcc
+
+TARGET = sldj
+SOURCES = $(shell find -name "*.c")
+OBJECTS = $(SOURCES:.c=.o)
+LIBSLDJ = libsldj/libsldj.so
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) -o $@ $<
+$(TARGET): $(OBJECTS) $(LIBSLDJ)
+ $(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(wildcard "libsldj/*.c") $(LDFLAGS)
+$(LIBSLDJ): $(wildcard libsldj/*.c libsldj/*.h)
+ @$(MAKE) -C libsldj
+clean:
+ rm *.o
+ rm $(TARGET)
+ @$(MAKE) -C libsldj clean
diff --git a/src/ffmpeg.c b/src/ffmpeg.c
new file mode 100644
index 0000000..72dfef8
--- /dev/null
+++ b/src/ffmpeg.c
@@ -0,0 +1,2 @@
+#include "ffmpeg.h"
+
diff --git a/src/ffmpeg.h b/src/ffmpeg.h
new file mode 100644
index 0000000..56ef6d9
--- /dev/null
+++ b/src/ffmpeg.h
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "sldjConfig.h"
+
+#ifndef FFMPEG_H
+#define FFMPEG_H
+
+#endif
+
diff --git a/src/libsldj/Makefile b/src/libsldj/Makefile
new file mode 100644
index 0000000..fc15314
--- /dev/null
+++ b/src/libsldj/Makefile
@@ -0,0 +1,11 @@
+TARGET = libsldj.so
+SOURCES = $(shell find -name "*.c")
+OBJECTS = $(SOURCES:.c=.o)
+
+%.o: %.c
+ $(CC) -c -fPIC -o $@ $<
+$(TARGET): $(OBJECTS)
+ $(CC) -shared -o $(TARGET) $(OBJECTS)
+clean:
+ rm *.o
+ rm $(TARGET)
diff --git a/src/libsldj/util.c b/src/libsldj/util.c
index 61def55..b7e445c 100644
--- a/src/libsldj/util.c
+++ b/src/libsldj/util.c
@@ -1,2 +1,2 @@
-#include "libsldj/util.h"
+#include "util.h"
diff --git a/include/libsldj/util.h b/src/libsldj/util.h
index 566ba8d..566ba8d 100644
--- a/include/libsldj/util.h
+++ b/src/libsldj/util.h
diff --git a/src/scripting.c b/src/scripting.c
index efd85b0..8dbdec5 100644
--- a/src/scripting.c
+++ b/src/scripting.c
@@ -75,8 +75,8 @@ void compileScript(SldjScripting* scripting, const char filePath[SLDJ_NAMEMAX])
tcc_set_error_func(scripting->state, stderr, handle_tcc_error);
tcc_set_output_type(scripting->state, TCC_OUTPUT_MEMORY);
- tcc_add_library_path(scripting->state, "./");
- tcc_add_library(scripting->state, "libsldj");
+ tcc_add_library_path(scripting->state, "./libsldj");
+ tcc_add_library(scripting->state, "sldj");
// Compile.
if (tcc_compile_string(scripting->state, scripting->fileBuf) < 0)