2018-09-29 15:57:51 +02:00
|
|
|
#
|
|
|
|
# This Make file is called from the core Makefile hierarchy with is a hierarchical
|
|
|
|
# make wwhich uses parent callbacks to implement inheritance. However is luac_cross
|
|
|
|
# build stands outside this and uses the host toolchain to implement a separate
|
|
|
|
# host build of the luac.cross image.
|
|
|
|
#
|
|
|
|
.NOTPARALLEL:
|
|
|
|
|
2019-01-24 21:29:32 +01:00
|
|
|
summary ?= @true
|
|
|
|
|
2018-09-29 15:57:51 +02:00
|
|
|
CCFLAGS:= -I..
|
|
|
|
LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld -lm -ldl -Wl,-Map=mapfile
|
|
|
|
|
|
|
|
CCFLAGS += -Wall
|
|
|
|
|
|
|
|
#DEFINES +=
|
|
|
|
|
|
|
|
TARGET = host
|
|
|
|
|
|
|
|
ifeq ($(FLAVOR),debug)
|
|
|
|
CCFLAGS += -O0 -g
|
|
|
|
TARGET_LDFLAGS += -O0 -g
|
|
|
|
DEFINES += -DDEBUG_COUNTS
|
|
|
|
else
|
|
|
|
FLAVOR = release
|
|
|
|
CCFLAGS += -O2
|
|
|
|
TARGET_LDFLAGS += -O2
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# This relies on the files being unique on the vpath
|
|
|
|
#
|
|
|
|
SRC := uz_unzip.c uz_zip.c crc32.c uzlib_inflate.c uzlib_deflate.c
|
|
|
|
vpath %.c .:..
|
|
|
|
|
|
|
|
ODIR := .output/$(TARGET)/$(FLAVOR)/obj
|
|
|
|
|
|
|
|
CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES)
|
|
|
|
DFLAGS = $(CCFLAGS) $(DDEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES)
|
|
|
|
|
|
|
|
ROOT = ../../..
|
|
|
|
CC := gcc
|
|
|
|
|
|
|
|
ECHO := echo
|
|
|
|
|
|
|
|
IMAGES := $(ROOT)/uz_zip $(ROOT)/uz_unzip
|
|
|
|
.PHONY: test clean all
|
|
|
|
|
|
|
|
all: $(IMAGES)
|
|
|
|
|
|
|
|
$(ROOT)/uz_zip : $(ODIR)/uz_zip.o $(ODIR)/crc32.o $(ODIR)/uzlib_deflate.o
|
2018-12-09 21:39:43 +01:00
|
|
|
$(summary) HOSTLD $@
|
2018-09-29 15:57:51 +02:00
|
|
|
$(CC) $^ -o $@ $(LDFLAGS)
|
|
|
|
|
|
|
|
$(ROOT)/uz_unzip : $(ODIR)/uz_unzip.o $(ODIR)/crc32.o $(ODIR)/uzlib_inflate.o
|
2018-12-09 21:39:43 +01:00
|
|
|
$(summary) HOSTLD $@
|
2018-09-29 15:57:51 +02:00
|
|
|
$(CC) $^ -o $@ $(LDFLAGS)
|
|
|
|
|
|
|
|
test :
|
|
|
|
@echo CC: $(CC)
|
|
|
|
@echo SRC: $(SRC)
|
|
|
|
@echo DEPS: $(DEPS)
|
|
|
|
|
|
|
|
clean :
|
|
|
|
$(RM) -r $(ODIR)
|
|
|
|
$(RM) $(IMAGES)
|
|
|
|
|
|
|
|
$(ODIR)/%.o: %.c
|
|
|
|
@mkdir -p $(ODIR);
|
2018-12-09 21:39:43 +01:00
|
|
|
$(summary) HOSTCC $(CURDIR)/$<
|
2018-09-29 15:57:51 +02:00
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
|