Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/osm0sis/mkbootfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2022-11-09 22:57:31 +0300
committerosm0sis <osm0sis@outlook.com>2022-11-09 22:57:31 +0300
commit887d083330f1729baacda4c69655e916c4d88d96 (patch)
tree7ceff3f9b6a6cca13c689e364b0dd8c60f2bc0fa
parent2d1100c6b333662b409372880c9a3773069bad21 (diff)
Makefile: update boilerplateHEADmaster
-rwxr-xr-xMakefile22
1 files changed, 15 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index ca6bdc08..2d4f0b7d 100755
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,21 @@
ifeq ($(CC),cc)
CC = gcc
endif
+AR = ar rc
ifeq ($(windir),)
-EXE =
+EXT =
RM = rm -f
+CP = cp
else
-EXE = .exe
+EXT = .exe
RM = del
+CP = copy /y
endif
CFLAGS += -ffunction-sections -O3
+INC = -I.
+
ifneq (,$(findstring darwin,$(CROSS_COMPILE)))
UNAME_S := Darwin
else
@@ -22,17 +27,20 @@ else
LDFLAGS += -Wl,--gc-sections -s
endif
-all:mkbootfs$(EXE)
+all:mkbootfs$(EXT)
static:
$(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS) -static"
-mkbootfs$(EXE):mkbootfs.o
+mkbootfs$(EXT):mkbootfs.o
$(CROSS_COMPILE)$(CC) -o $@ $^ $(LDFLAGS)
-mkbootfs.o:mkbootfs.c
- $(CROSS_COMPILE)$(CC) -o $@ $(CFLAGS) -c $< -I. -Werror
+%.o:%.c
+ $(CROSS_COMPILE)$(CC) -o $@ $(CFLAGS) -c $< $(INC) -Werror
+
+install:
+ install -m 755 mkbootfs$(EXT) $(PREFIX)/bin
clean:
$(RM) mkbootfs
- $(RM) *.~ *.exe *.o
+ $(RM) *.a *.~ *.exe *.o