Skip to content

Commit

Permalink
Correctly use the CFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
WestleyK committed Nov 30, 2019
1 parent 6a4e87f commit d1686a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lf_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: make test [default]
run: make test
- name: make clean && make without-ouner-group-names
run: make clean && make without-ouner-group-names
run: make cleanall && make WITH_ID=true
- name: make test [without-ouner-group-names]
run: make test

36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# email: westleyr@nym.hush.com
# Date: Nov 23, 2019
# https://github.com/WestleyR/list-files
# Version-1.0.12
# Version-2.0.0
#
# The Clear BSD License
#
Expand All @@ -26,6 +26,14 @@ ifeq ($(DEBUG), true)
CFLAGS += -DDEBUG
endif

ifeq ($(STATIC), true)
CFLAGS += -static -DWITHOUT_NAME_GROUP_OUTPUT
endif

ifeq ($(WITH_ID), true)
CFLAGS += -DWITHOUT_NAME_GROUP_OUTPUT
endif

SRC = $(wildcard src/*.c)
SRC += $(wildcard deps/*/*.c)

Expand All @@ -40,29 +48,21 @@ options:
@echo ""
@echo "$$ make [option]"
@echo ""
@echo " [no-option], all compile the project"
@echo " static compile the static project"
@echo " without-owner-group-names dont print the user/group names,"
@echo " DEBUG=true compile target as debug"
@echo " instead print the uid/gid."
@echo " install install the binary to the PREFIX,"
@echo " (dafault '/usr/local/bin')"
@echo " clean clean the binary"
@echo " uninstall uninstall the binary from PREFIX"
@echo " [no-option], all compile the project"
@echo " STATIC=true compile the static project"
@echo " WITH_ID=true dont print the user/group names,"
@echo " DEBUG=true compile target as debug"
@echo " instead print the uid/gid."
@echo " install install the binary to the PREFIX,"
@echo " (dafault '/usr/local/bin')"
@echo " clean clean the binary"
@echo " uninstall uninstall the binary from PREFIX"
@echo ""

.PHONY:
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJS)

.PHONY:
static: $(OBJS)
$(CC) $(CFLAGS) -DWITHOUT_NAME_GROUP_OUTPUT -static -o $(TARGET) $(MAIN)

.PHONY:
without-ouner-group-names: $(OBJS)
$(CC) $(CFLAGS) -DWITHOUT_NAME_GROUP_OUTPUT -o $(TARGET) $(MAIN)

.PHONY:
%.o: %.c
$(CC) $(DEP_FLAG) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
Expand Down
2 changes: 1 addition & 1 deletion src/extcmp.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// created by: WestleyR
// email: westleyr@nym.hush.com
// https://github.com/WestleyR/???
// https://github.com/WestleyR/list-files
// date: Nov 29, 2019
// version-1.0.0
//
Expand Down

0 comments on commit d1686a2

Please sign in to comment.