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:
-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