Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ugen to repo #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
default: all

SRC_DIRS := . src src/libmld src/libp src/libu src/libxmalloc src/uopt
SRC_DIRS := . src src/libmld src/libp src/libu src/libxmalloc
UOPT_DIR := src/uopt
UGEN_DIR := src/ugen

AVOID_UB ?= 1

Expand All @@ -12,20 +14,26 @@ ifeq ($(AVOID_UB),1)
endif

BUILD_DIR := build
ALL_DIRS := $(addprefix $(BUILD_DIR)/,$(SRC_DIRS))
ALL_DIRS := $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(UOPT_DIR) $(UGEN_DIR))

C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
O_FILES := $(addprefix $(BUILD_DIR)/,$(C_FILES:.c=.o))
UOPT_C_FILES := $(C_FILES) $(foreach dir,$(UOPT_DIR),$(wildcard $(dir)/*.c))
UGEN_C_FILES := $(C_FILES) $(foreach dir,$(UGEN_DIR),$(wildcard $(dir)/*.c))
UOPT_O_FILES := $(addprefix $(BUILD_DIR)/,$(UOPT_C_FILES:.c=.o))
UGEN_O_FILES := $(addprefix $(BUILD_DIR)/,$(UGEN_C_FILES:.c=.o))
DEP_FILES := $(O_FILES:.o=.d)

# Ensure build directories exist before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)

TARGET := $(BUILD_DIR)/uopt
TARGETS := $(BUILD_DIR)/uopt $(BUILD_DIR)/ugen

all: $(TARGET)
all: $(TARGETS)

$(TARGET): $(O_FILES)
$(BUILD_DIR)/uopt: $(UOPT_O_FILES)
$(CC) -o $@ $^ $(LDFLAGS)

$(BUILD_DIR)/ugen: $(UGEN_O_FILES)
$(CC) -o $@ $^ $(LDFLAGS)

$(BUILD_DIR)/%.o: %.c
Expand Down
1 change: 0 additions & 1 deletion libcwrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ double _atod(const char *str) {
int main1(int argc, char *argv[]);

int main(int argc, char *argv[]) {
puts("main");
__Argc = argc;
__Argv = argv;
output.c_file = stdout;
Expand Down
Loading