1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
##################################################################################
# #
# A very simple makefile which compiles the autogenerated "fat" commandline #
# tools in src_fat of the MCPL distribution. #
# #
# Note that this simply builds the final executables directly in src_fat, with #
# no intermediate build output. #
# #
# Refer to the INSTALL file from the MCPL distribution for more details. #
# #
# Written 2017-2019 by T. Kittelmann. #
# #
##################################################################################
SHELL = /bin/sh
CFLAGS = -std=c99
CFLAGS_EXTRA ?=
LDFLAGS = -lm
LDFLAGS_EXTRA ?=
DEBUGFLAGS = -g -O0
RELEASEFLAGS = -O2 -DNDEBUG
SRCDIR = $(dir $(lastword $(MAKEFILE_LIST)))
DESTDIR = $(SRCDIR)
CC ?= gcc
TARGETS = $(DESTDIR)mcpl2phits $(DESTDIR)phits2mcpl $(DESTDIR)mcpl2ssw $(DESTDIR)ssw2mcpl $(DESTDIR)mcpltool
CFLAGS += $(CFLAGS_EXTRA)
LDFLAGS += $(LDFLAGS_EXTRA)
all: release
release: CFLAGS += $(RELEASEFLAGS)
release: $(TARGETS)
debug: CFLAGS += $(DEBUGFLAGS)
debug: $(TARGETS)
.PHONY : all clean release debug
clean:
rm -f $(TARGETS)
$(DESTDIR)mcpltool: $(SRCDIR)mcpltool_app_fat.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
$(DESTDIR)ssw2mcpl: $(SRCDIR)ssw2mcpl_app_fat.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
$(DESTDIR)mcpl2ssw: $(SRCDIR)mcpl2ssw_app_fat.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
$(DESTDIR)phits2mcpl: $(SRCDIR)phits2mcpl_app_fat.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
$(DESTDIR)mcpl2phits: $(SRCDIR)mcpl2phits_app_fat.c
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
|