libmonochrome/Makefile

67 lines
2.1 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#******************************************************************************#
# #
# Makefile #
# | Project : libmonochrome #
# #
# By: thomas <thomas@touhey.fr> #
# Last updated: 2015/12/23 10:02:49 #
# #
#******************************************************************************#
# INCLUDE CONFIGURATION
include $(CURDIR)/Makefile.cfg
# DEDUCED VARIABLES
ALLOBJ = $(SRC:%=$(OBJDIR)/%.o)
ALLINC = $(INCPUB:%=$(INCDIR)/%.h) $(INCINT:%=$(INCDIR)/%.h)
# STYLE VARS
define \n
endef
# 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)
$(CC) -c -o $@ $< $(CFLAGS)
## Make the library
lib$(NAME).a: $(OBJDIR) $(ALLOBJ)
$(AR) rc $@ $(ALLOBJ)
$(RANLIB) $@
## Clean the object files and compressed manpages
clean:
$(RM) $(ALLOBJ)
## Clean the object files and the binary
fclean: clean
$(RM) lib$(NAME).a
## Remake the project
re: fclean all
## Package lib
package: lib$(NAME)_$(VERSION).deb
lib$(NAME)_$(VERSION).deb: lib$(NAME).a $(INCPUB:%=$(INCDIR)/%.h)
$(INST) -m 755 -d $(TGTRT)$(TGTDIR)/lib/$(NAME)/$(VERSION)/include
$(INST) -m 644 lib$(NAME).a $(TGTRT)$(TGTDIR)/lib/$(NAME)/$(VERSION)
$(foreach inc, $(INCPUB), \
$(INST) -m 755 -d $(TGTRT)$(TGTDIR)/lib/$(NAME)/$(VERSION)/include/$(shell dirname $(inc).h)$(\n)
$(INST) -m 644 $(INCDIR)/$(inc).h $(TGTRT)$(TGTDIR)/lib/$(NAME)/$(VERSION)/include/$(shell dirname $(inc).h)$(\n))
$(INST) -m 755 -d $(TGTRT)$(TGTMANDIR)/man3
$(foreach man, $(MAN3), \
$(INST) -m 644 $(MANDIR)/man3/$(man) $(TGTRT)$(TGTMANDIR)/man3$(\n))
## Doz rulz are phunny
.PHONY: all clean fclean re package install
# END OF FILE