LD65_OBJ = $(datadir)/lib
LD65_CFG = $(datadir)/cfg
+ifdef CMD_EXE
+ NULLDEV = nul:
+ DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
+ MKDIR = mkdir $(subst /,\,$1)
+ RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
+else
+ NULLDEV = /dev/nul
+ MKDIR = mkdir -p $1
+ RMDIR = $(RM) -r $1
+endif
+
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
$(info USER_CFLAGS: $(USER_CFLAGS))
endif
-ifndef GIT_SHA
- GIT_SHA := $(if $(wildcard ../.git),$(shell git rev-parse --short HEAD))
+ifdef GIT_SHA
+ $(info GIT_SHA: $(GIT_SHA))
+else
+ GIT_SHA := $(shell git rev-parse --short HEAD 2>$(NULLDEV))
ifneq ($(words $(GIT_SHA)),1)
GIT_SHA := N/A
+ $(info GIT_SHA: N/A)
endif
endif
-$(info GIT_SHA: $(GIT_SHA))
CFLAGS += -MMD -MP -O -I common \
-Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \
EXE_SUFFIX=.exe
endif
-ifdef CMD_EXE
- DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
- MKDIR = mkdir $(subst /,\,$1)
- RMDIR = $(if $(DIRLIST),rmdir /s /q $(subst /,\,$(DIRLIST)))
-else
- MKDIR = mkdir -p $1
- RMDIR = $(RM) -r $1
-endif
-
all bin: $(PROGS)
mostlyclean: