Add standard build targets (distclean, realclean, install, uninstall).
This commit is contained in:
parent
06679a2790
commit
62e2095f31
21
Makefile
21
Makefile
|
|
@ -1,4 +1,8 @@
|
||||||
MODS := io
|
MODS := io
|
||||||
|
PREFIX := /usr/local
|
||||||
|
|
||||||
|
INSTALL := install
|
||||||
|
RM := rm -f
|
||||||
|
|
||||||
CPPFLAGS := -I.
|
CPPFLAGS := -I.
|
||||||
CFLAGS := -std=c99 -Wall
|
CFLAGS := -std=c99 -Wall
|
||||||
|
|
@ -14,7 +18,7 @@ GCDA := $(OBJS:%.o=%.gcda)
|
||||||
ifeq ($(DEBUG),yes)
|
ifeq ($(DEBUG),yes)
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
PROFILE := no
|
PROFILE := no
|
||||||
dummy := $(shell rm -f rosella $(OBJS) $(GCDA) $(GCNO))
|
dummy := $(shell $(RM) rosella $(OBJS) $(GCDA) $(GCNO))
|
||||||
else
|
else
|
||||||
CFLAGS += -O3 -DNDEBUG -march=nocona
|
CFLAGS += -O3 -DNDEBUG -march=nocona
|
||||||
endif
|
endif
|
||||||
|
|
@ -26,16 +30,25 @@ endif
|
||||||
|
|
||||||
ifneq (,$(wildcard *.gcda mods/*.gcda))
|
ifneq (,$(wildcard *.gcda mods/*.gcda))
|
||||||
CFLAGS += -fprofile-use
|
CFLAGS += -fprofile-use
|
||||||
dummy := $(shell rm -f rosella $(OBJS))
|
dummy := $(shell $(RM) rosella $(OBJS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: rosella
|
all: rosella
|
||||||
depend: $(DEPS)
|
depend: $(DEPS)
|
||||||
|
|
||||||
.PHONY: all clean depend
|
.PHONY: all clean distclean realclean depend install uninstall
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f rosella $(OBJS) $(DEPS) $(GCDA) $(GCNO)
|
-$(RM) rosella $(OBJS) $(DEPS) $(GCDA) $(GCNO)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
realclean: distclean
|
||||||
|
|
||||||
|
install: rosella
|
||||||
|
$(INSTALL) -t $(PREFIX)/bin rosella
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
$(RM) $(PREFIX)/bin/rosella
|
||||||
|
|
||||||
%.d: %.c
|
%.d: %.c
|
||||||
$(CC) $(CPPFLAGS) -MM $< -MF $@ -MT $(<:%.c=%.o) -MT $@
|
$(CC) $(CPPFLAGS) -MM $< -MF $@ -MT $(<:%.c=%.o) -MT $@
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue