logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

main.mk (978B)


  1. # SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
  2. # SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  3. #
  4. # SPDX-License-Identifier: GPL-3.0-or-later
  5. CC = tcc
  6. AR = tcc -ar
  7. CPPFLAGS = -DENABLE_NLS=0 \
  8. -DHAVE_FCNTL_H \
  9. -DHAVE_ALLOCA_H \
  10. -DSED_FEATURE_VERSION=\"4.0\" \
  11. -DVERSION=\"4.0.9\" \
  12. -DPACKAGE=\"sed\"
  13. CFLAGS = -I . -I lib
  14. LDFLAGS = -L . -lsed -static
  15. .PHONY: all
  16. ifeq ($(LIBC),mes)
  17. LIB_SRC = getline
  18. else
  19. LIB_SRC = alloca
  20. endif
  21. LIB_SRC += getopt1 getopt utils regex obstack strverscmp mkstemp
  22. LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC)))
  23. SED_SRC = compile execute regexp fmt sed
  24. SED_OBJ = $(addprefix sed/, $(addsuffix .o, $(SED_SRC)))
  25. all: sed/sed
  26. lib/regex.h: lib/regex_.h
  27. cp $< $@
  28. lib/regex.o: lib/regex.h
  29. libsed.a: $(LIB_OBJ)
  30. $(AR) cr $@ $^
  31. sed/sed: libsed.a $(SED_OBJ)
  32. $(CC) $^ $(LDFLAGS) -o $@
  33. install:
  34. install -D sed/sed $(DESTDIR)$(PREFIX)/bin/sed