libmonochrome/Makefile

67 lines
1.8 KiB
Makefile
Raw Normal View History

2016-05-22 23:43:10 +02:00
#!/usr/bin/make -f
2016-04-21 22:27:29 +02:00
#******************************************************************************#
# #
# Makefile #
2016-04-22 07:06:40 +02:00
# | Project : libmonochrome #
2016-04-21 22:27:29 +02:00
# #
# By: thomas <thomas@touhey.fr> #
# Last updated: 2015/12/23 10:02:49 #
# #
#******************************************************************************#
# INCLUDE CONFIGURATION
include $(CURDIR)/Makefile.vars
2016-05-22 23:29:03 +02:00
include $(CURDIR)/Makefile.cfg
2016-04-21 22:27:29 +02:00
# DEDUCED VARIABLES
ALLOBJ = $(SRC:%=$(OBJDIR)/%.o)
ALLINC = $(INCPUB:%=$(INCDIR)/%.h) $(INCINT:%=$(INCDIR)/%.h)
# STYLE VARS
define \n
endef
2016-04-21 22:27:29 +02:00
# RULES
## Make everything (default)
all: lib$(NAME).a
## Make the object directory
$(OBJDIR):
$(MKDIR) $@
## Make an object file out of a C source file
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(ALLINC)
2016-04-21 22:27:29 +02:00
$(CC) -c -o $@ $< $(CFLAGS)
## Make the library
lib$(NAME).a: $(OBJDIR) $(ALLOBJ)
2016-04-26 12:05:45 +02:00
$(AR) rc $@ $(ALLOBJ)
2016-04-21 22:27:29 +02:00
$(RANLIB) $@
## Clean the object files and compressed manpages
2016-04-21 22:27:29 +02:00
clean:
$(RM) $(ALLOBJ)
## Clean the object files and the binary
fclean: clean
$(RM) lib$(NAME).a
## Remake the project
re: fclean all
## Install project
install:
include $(CURDIR)/Makefile.cfg
$(INST) -D -m 644 lib$(NAME).a $(ILIBDIR)/lib$(NAME).a
$(foreach inc, $(INCPUB), \
$(INST) -D -m 644 $(INCDIR)/$(inc).h $(IINCDIR)/$(inc).h$(\n))
$(foreach man, $(MAN), \
$(INST) -D -m 644 $(MANDIR)/$(man) $(IMANDIR)/$(man)$(\n))
$(GZIP) $(MAN:%=$(IMANDIR)/%)
2016-05-18 19:55:20 +02:00
2016-04-21 22:27:29 +02:00
## Doz rulz are phunny
.PHONY: all clean fclean re install
2016-04-21 22:27:29 +02:00
# END OF FILE