#!/usr/bin/make -f #******************************************************************************# # # # Makefile # # | Project : libmonochrome # # # # By: thomas # # Last updated: 2015/12/23 10:02:49 # # # #******************************************************************************# # INCLUDE CONFIGURATION include $(CURDIR)/Makefile.vars 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 ## 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)/%) ## Doz rulz are phunny .PHONY: all clean fclean re install # END OF FILE