1
0
forked from bonsai/harakit
coreutils/bin/Makefile
2024-03-31 00:12:21 +05:45

92 lines
2.5 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Copyright (c) 20232024 Emma Tebibyte <emma@tebibyte.media>
# Copyright (c) 20232024 DTB <trinity@trinity.moe>
# Copyright (c) 2023 Sasha Koshka <sashakoshka@tebibyte.media>
# Copyright (c) 2024 Aaditya Aryal <aryalaadi123@gmail.com>
# SPDX-License-Identifier: FSFAP
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
include ../config.mk
.PHONY: bin
bin: dj false fop hru intcmp mm npc rpn scrut str strcmp swab true
.PHONY: lib
# TODO: this does not have to be here
.PHONY: prepare
prepare:
# keep ..$(BUILD)/include until bindgen(1) has stdin support
# https://github.com/rust-lang/rust-bindgen/issues/2703
mkdir -p ../$(BUILD)/bin ../$(BUILD)/include ../$(BUILD)/lib
mkdir -p ../$(BUILD)/test ../$(BUILD)/o
.PHONY: dj
dj: ../$(BUILD)/bin/dj
../$(BUILD)/bin/dj: dj/dj.c prepare
$(CC) $(CFLAGS) -o $@ dj/dj.c
.PHONY: false
false: ../$(BUILD)/bin/false
../$(BUILD)/bin/false: false/false.c prepare
$(CC) $(CFLAGS) -o $@ false/false.c
.PHONY: fop
fop: ../$(BUILD)/bin/fop
../$(BUILD)/bin/fop: fop/fop.rs prepare lib
$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ fop/fop.rs
.PHONY: hru
hru: ../$(BUILD)/bin/hru
../$(BUILD)/bin/hru: hru/hru.rs prepare lib
$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ hru/hru.rs
.PHONY: intcmp
intcmp: ../$(BUILD)/bin/intcmp
../$(BUILD)/bin/intcmp: intcmp/intcmp.c prepare
$(CC) $(CFLAGS) -o $@ intcmp/intcmp.c
.PHONY: mm
mm: ../$(BUILD)/bin/mm
../$(BUILD)/bin/mm: mm/mm.c prepare
$(CC) $(CFLAGS) -o $@ mm/mm.c
.PHONY: npc
npc: ../$(BUILD)/bin/npc
../$(BUILD)/bin/npc: npc/npc.c prepare
$(CC) $(CFLAGAS) -o $@ npc/npc.c
.PHONY: rpn
rpn: ../$(BUILD)/bin/rpn
../$(BUILD)/bin/rpn: rpn/rpn.rs prepare lib
$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ rpn/rpn.rs
.PHONY: scrut
scrut: ../$(BUILD)/bin/scrut
../$(BUILD)/bin/scrut: scrut/scrut.c prepare
$(CC) $(CFLAGS) -o $@ scrut/scrut.c
.PHONY: str
str: ../$(BUILD)/bin/str
../$(BUILD)/bin/str: str/str.c prepare
$(CC) $(CFLAGS) -o $@ str/str.c
.PHONY: strcmp
strcmp: ../$(BUILD)/bin/strcmp
../$(BUILD)/bin/strcmp: strcmp/strcmp.c prepare
$(CC) $(CFLAGS) -o $@ strcmp/strcmp.c
.PHONY: swab
swab: ../$(BUILD)/bin/swab
../$(BUILD)/bin/swab: swab/swab.rs prepare lib
$(RUSTC) $(RUSTFLAGS) --extern getopt=../$(BUILD)/o/libgetopt.rlib \
--extern sysexits=../$(BUILD)/o/libsysexits.rlib \
-o $@ swab/swab.rs
.PHONY: true
true: ../$(BUILD)/bin/true
../$(BUILD)/bin/true: true/true.c prepare
$(CC) $(CFLAGS) -o $@ true/true.c