Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
makefile_path := $(abspath $(firstword $(MAKEFILE_LIST)))
TOP := $(dir $(makefile_path))
TOP := .
include $(TOP)/mk/common.mk
include $(TOP)/mk/rules.mk

Expand Down Expand Up @@ -75,9 +74,10 @@ clobber::
DROP_TARGETS = showbuilddir clean clobber distclean NODEPS
NODEPS:; # phony target just to prevent dependency generation
ifneq ($(BUILDDIR),.)
makefile_path := $(abspath $(firstword $(MAKEFILE_LIST)))
all $(filter-out $(DROP_TARGETS),$(MAKECMDGOALS))::
mkdir -p $(BUILDDIR)
$(MAKE) TOOLDIR=$(BUILDDIR) BUILDDIR=. -C $(BUILDDIR) -f $(makefile_path) TOP=$(TOP) $@
$(MAKE) TOOLDIR=$(abspath $(BUILDDIR)) BUILDDIR=. -C $(BUILDDIR) -f $(makefile_path) TOP=$(CURDIR) $@
else

all: $(TARGETS) | $(TOP)/build/share/tenyr/rsrc
Expand Down
2 changes: 1 addition & 1 deletion ex/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TOP := $(abspath ..)
TOP := ..
include $(TOP)/mk/common.mk
include $(TOP)/mk/rules.mk

Expand Down
2 changes: 1 addition & 1 deletion hw/icarus/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TOP := $(abspath ../..)
TOP := ../..
include $(TOP)/mk/common.mk
include $(TOP)/mk/rules.mk

Expand Down
12 changes: 0 additions & 12 deletions hw/verilog/Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions mk/misc.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
makefile_path := $(abspath $(firstword $(MAKEFILE_LIST)))
TOP := $(dir $(makefile_path))/..
TOP := ..
include $(TOP)/mk/common.mk
include $(TOP)/mk/rules.mk

Expand Down Expand Up @@ -291,7 +291,7 @@ check_hw_icarus_run: $(SDL_RUNS:%=test_run_%)

ifneq ($(SDL),0)
RUNS += $(SDL_RUNS)
tsim_FLAGS += -p paths.share=$(call os_path,$(TOP))
tsim_FLAGS += -p paths.share=$(call os_path,$(TOP)/)
tsim_FLAGS += -@ $(TOP)/plugins/sdl.rcp
endif

Expand Down
4 changes: 2 additions & 2 deletions mk/sdl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ libtenyrsdl%$(DYLIB_SUFFIX) $(PDEVICES_SDL:%=devices/%.d): \
libtenyrsdl%$(DYLIB_SUFFIX) $(PDEVICES_SDL:%=devices/%.d): \
CPPFLAGS += $(call sdl2_pkg_config,--cflags-only-other,sdl2 SDL2_image)
libtenyrsdl%$(DYLIB_SUFFIX): LDLIBS += $(call sdl2_pkg_config,--libs,sdl2 SDL2_image)
libtenyrsdlvga$(DYLIB_SUFFIX): | $(TOP)rsrc/font10x15/invert.font10x15.png
$(TOP)rsrc/font10x15/%:
libtenyrsdlvga$(DYLIB_SUFFIX): | $(TOP)/rsrc/font10x15/invert.font10x15.png
$(TOP)/rsrc/font10x15/%:
$(MAKE) -C $(@D) $(@F)

# Do not halt the build for platforms on which the feature-flag _BSD_SOURCE is
Expand Down
3 changes: 3 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ static inline char *strcopy(char *dest, const char *src, size_t sz)

long long numberise(char *str, int base);

// build_path expects a path to a file, or else a path to a directory including
// a trailing slash. It returns a string whose ownership passes to the caller
// and which must be deallocated with free().
char *build_path(const char *base, const char *fmt, ...);

#define ALIASING_CAST(Type,Expr) \
Expand Down
3 changes: 1 addition & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
makefile_path := $(abspath $(firstword $(MAKEFILE_LIST)))
TOP := $(abspath $(dir $(makefile_path))/..)
TOP := ..
include $(TOP)/mk/common.mk
include $(TOP)/mk/rules.mk

Expand Down