Skip to content

Commit

Permalink
Makefile fixups
Browse files Browse the repository at this point in the history
Fixes a few goofs left over from 6f51ba0. Namely, the missing
'generated' directory, and some targets that are no longer needed.
  • Loading branch information
vkoskiv committed Jan 23, 2025
1 parent a040c31 commit 97dbcd3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BINDIR=bin

all: $(BINDIR)/$(BIN)

SRCS=$(shell find src/lib src/driver src/common generated/ -name '*.c') generated/gitsha1.c
SRCS=$(shell find src/lib src/driver src/common -name '*.c') generated/gitsha1.c
OBJS=$(SRCS:%.c=$(BINDIR)/%.o)
DEPS=$(OBJS:%.o=%.d)

Expand Down
2 changes: 1 addition & 1 deletion cosmo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(OBJDIR_cosmo)/%.o: %.c $(OBJDIR_cosmo)
@mkdir -p '$(@D)'
@echo "cosmocc $<"
@$(CC_cosmo) $(CFLAGS) -c $< -o $@
$(OBJDIR_cosmo): dummy
$(OBJDIR_cosmo):
mkdir -p $@
$(BIN_cosmo): $(OBJS_cosmo) $(OBJDIR_cosmo)
@echo "LD $@"
Expand Down
Empty file added generated/.keep
Empty file.
4 changes: 2 additions & 2 deletions lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIB=lib/libc-ray.so
BIN_lib=lib/c-ray
OBJDIR_lib=lib/obj_lib
OBJDIR_driver=lib/obj_driver
SRCS_lib=$(shell find src/lib src/common generated/ -name '*.c')
SRCS_lib=$(shell find src/lib src/common -name '*.c') generated/gitsha1.c
OBJS_lib=$(patsubst %.c, $(OBJDIR_lib)/%.o, $(SRCS_lib))
SRCS_driver=$(shell find src/driver src/common -name '*.c')
OBJS_driver=$(patsubst %.c, $(OBJDIR_driver)/%.o, $(SRCS_driver))
Expand Down Expand Up @@ -45,7 +45,7 @@ $(OBJDIR_lib)/%.o: %.c $(OBJDIR_lib)
@mkdir -p '$(@D)'
@echo "CC -fPIC $<"
@$(CC) -DCR_BUILDING_LIB $(CFLAGS) -fvisibility=hidden -c -fPIC $< -o $@
$(OBJDIR_lib): dummy
$(OBJDIR_lib):
mkdir -p $@
$(OBJDIR_driver):
mkdir -p $@
Expand Down
2 changes: 1 addition & 1 deletion tests/test.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BIN_test=tests/testrunner
OBJDIR_test=tests/obj
SRCS_test=$(shell find src/lib src/driver src/common generated/ tests/ -name '*.c' -not -name 'main.c')
SRCS_test=$(shell find src/lib src/driver src/common tests/ -name '*.c' -not -name 'main.c')
TEST_HDRS=$(shell find tests/ -name '*.h')
OBJS_test=$(patsubst %.c, $(OBJDIR_test)/%.o, $(SRCS_test))
# suite=vector
Expand Down

0 comments on commit 97dbcd3

Please sign in to comment.