Skip to content

Commit

Permalink
update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
HiGarfield committed Aug 28, 2024
1 parent a403586 commit fb36ee4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ ifeq ($(UNAME), FreeBSD)
override LDFLAGS += -lkvm
endif

ifeq ($(shell echo "int main(void){return 0;}" | $(CC) -x c - -lrt -o /dev/null 2>&1),)
override LDFLAGS += -lrt
endif
override LDFLAGS += -lrt

override CFLAGS += -ffunction-sections -fdata-sections -Os -flto
override LDFLAGS += -Wl,--gc-sections -s -flto

.PHONY: all clean

Expand Down
7 changes: 4 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ ifeq ($(UNAME), FreeBSD)
override LDFLAGS += -lkvm
endif

ifeq ($(shell echo "int main(void){return 0;}" | $(CC) -x c - -lrt -o /dev/null 2>&1),)
override LDFLAGS += -lrt
endif
override LDFLAGS += -lrt

override CFLAGS += -ffunction-sections -fdata-sections -Os -flto
override LDFLAGS += -Wl,--gc-sections -s -flto

.PHONY: all clean

Expand Down

0 comments on commit fb36ee4

Please sign in to comment.