| # Copyright 2019, Data61 | |
| # Commonwealth Scientific and Industrial Research Organisation (CSIRO) | |
| # ABN 41 687 119 230. | |
| # | |
| # This software may be distributed and modified according to the terms of | |
| # the GNU General Public License version 2. Note that NO WARRANTY is provided. | |
| # See "LICENSE_GPLv2.txt" for details. | |
| # | |
| # @TAG(DATA61_GPL) | |
| # | |
| NAME=serial | |
| SRC=serial.cogent | |
| LIBGUM=$(shell cogent --libgum-dir) | |
| ACFILES=serial.ac | |
| PP=$(ACFILES:.ac=_pp.ac) | |
| PPINFER=$(ACFILES:.ac=_pp_inferred.c) | |
| ABSDIR=./abstract | |
| #OBJ=$(PPINFER:.c=.o) | |
| CFLAGS+=-I. -I$(LIBGUM) -I$(LIBGUM)/gum/anti -I ./libutils/include/ -std=gnu99 | |
| .PHONY: default clean gen-anti test | |
| .SECONDARY: | |
| default: all | |
| all: gen-anti $(OBJ) | |
| # $(CC) -o $(NAME) $(OBJ) | |
| test: gen-anti $(OBJ) | |
| $(OBJ): $(PPINFER) | |
| gen-anti: | |
| mkdir -p $(ABSDIR) | |
| cogent $(SRC) -g -Od -ogenerated --fno-fncall-as-macro --ffunc-purity-attr \ | |
| --infer-c-types="$(AHFILES)" \ | |
| --Wno-warn --infer-c-funcs="$(ACFILES)" \ | |
| --cpp-args="\$$CPPIN -o \$$CPPOUT -E -P $(CFLAGS)" \ | |
| --ext-types=types.cfg \ | |
| --entry-funcs=entrypoints.cfg \ | |
| clean: | |
| rm -f $(COUTPUT) $(HOUTPUT) $(PP) $(PPINFER) $(OBJ) | |
| rm -rf generated.h generated.c | |
| rm -f $(ABSDIR)/*.h | |
| rm -rf $(ABSDIR) | |
| rm -f $(NAME) |