Skip to content

Instantly share code, notes, and snippets.

@trentgill
Created December 2, 2019 21:07
Show Gist options
  • Save trentgill/390fc44478384a87ef18afb201d108fc to your computer and use it in GitHub Desktop.
Save trentgill/390fc44478384a87ef18afb201d108fc to your computer and use it in GitHub Desktop.
TARGET = without
WRLIB=submodules/wrLib
WRDSP=submodules/wrDsp
LUAS=submodules/lua
CC = gcc
LD = gcc
SRC = main.c \
$(wildcard lib/*.c) \
$(WRLIB)/wrMath.c \
$(WRLIB)/wrWav.c \
$(WRDSP)/wrBlocks.c \
$(WRDSP)/wrBuffer.c \
$(WRDSP)/wrPlayer.c \
OBJDIR = .
OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
EXECUTABLE = $(TARGET)
INCLUDES = \
-I$(WRLIB)/ \
-I$(WRDSP)/ \
-I$(LUAS)/ \
CFLAGS += -std=c99
CFLAGS += -Wall
CFLAGS += -I. -I./ $(INCLUDES)
LDFLAGS =
LIBS += -L/usr/local/lib/lua/5.3
LIBS += -lm -lc -lsoundio -llua -ldl -l:curses_c.so -lncurses
all: $(OBJS)
$(LD) $(CFLAGS) $(OBJS) $(LIBS) -o $(EXECUTABLE)
@echo "jackd -d alsa -d hw:1 &"
%.o: %.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo $@
clean:
rm $(OBJS) $(EXECUTABLE)
.PHONY: all clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment