# $Id $
CC = gcc
RM = rm
EXE = merc.exe
PROF = -O -ggdb
CYGWIN = -DCYGWIN
ECHOCMD = echo -e
LIBS = -lcrypt
#more colors just to piss Tyche off
D_RED = \e# $Id $
CC = gcc
RM = rm
EXE = merc.exe
PROF = -O -ggdb
CYGWIN = -DCYGWIN
ECHOCMD = echo -e
LIBS = -lcrypt
#more colors just to piss Tyche off
D_RED = \e[0;31m
L_RED = \e[1;31m
D_BLUE = \e[0;34m
L_BLUE = \e[1;34m
D_GREEN = \e[0;32m
L_GREEN = \e[1;32m
L_GREY = \e[0;37m
L_WHITE = \e[1;37m
L_NRM = \e[0;00m
D_PURPLE = \e[0;35m
L_MAGENTA = \e[1;35m
D_BROWN = \e[0;33m
L_YELLOW = \e[1;33m
D_CYAN = \e[0;36m
L_CYAN = \e[1;36m
# Use these two lines to use crypt(), ie on Linux systems.
# C_FLAGS = $(PROF) -Wall
# L_FLAGS = $(PROF) -lcrypt
# Uncomment these two lines to use plaintext passwords.
# This is how you fix the 'crypt' linking errors!
L_FLAGS = $(PROF)
C_FLAGS = -Wall $(PROF) -DNOCRYPT -DQMFIXES
# Source Files
SRC_FILES := $(wildcard *.c)
# Backup Files
BCK_DIR = backup
BCK_FILES := $(BCK_DIR)/*
# Object Files
OBJ_DIR = obj
OBJ_FILES := $(patsubst %.c,$(OBJ_DIR)/%.o,$(SRC_FILES))
# Header Files need to find out where to put these in the make
H_FILES = $(wildcard *.h)
merc: $(OBJ_FILES)
@$(ECHOCMD) "$(L_RED)[- $(L_WHITE)Rebuilding MUD executable: $(L_GREEN)merc.exe$(L_RED) -]$(L_NRM)"
@$(ECHOCMD) "$(L_RED)[- $(L_YELLOW)**********$(L_CYAN)Compile Complete$(L_YELLOW)**********$(L_RED) -]$(L_NRM)"
@$(RM) -f $(EXE)
@$(CC) $(L_FLAGS) -o $(EXE) $(OBJ_FILES) $(LIBS)
$(OBJ_DIR)/%.o: %.c
@$(ECHOCMD) "$(L_RED)–> $(L_WHITE)Compiling file: $(L_MAGENTA)$<$(L_RED) <–$(L_NRM)"
@$(CC) $(C_FLAGS) -c -o $@ $<
@$(ECHOCMD) "$(L_RED)[- $(L_YELLOW)$<$(L_NRM) compiled $(L_GREEN)OK$(L_RED) -]$(L_NRM)"
clean:
@$(ECHOCMD) "$(L_RED)–> $(L_BLUE)Cleaning up for full make… $(L_NRM)\c"
@$(RM) -f $(OBJ_FILES) $(EXE) *~ *.bak *.orig *.rej
@$(ECHOCMD) "$(L_RED)–> $(L_GREEN)done$(L_NRM). $(L_RED)<–$(L_NRM)"
@make
cleanup:
@$(ECHOCMD) "$(L_RED)–> $(L_BLUE)Making clean for backing up $(L_NRM)\c"
@$(RM) -f $(OBJ_FILES) $(BCK_FILES) $(EXE) *~ *.bak *.orig *.rej
@$(ECHOCMD) "$(L_RED)–> $(L_GREEN)Ready to make a backup now$(L_NRM). $(L_RED)<–$(L_NRM)"
[/code]
i made some corrections based on what tyche said but i was unable to find any makefiles that had header files mentioned at all except afkmud but that was under an indent option which i don't know anything about. apparently my makefile is lacking just as much as every makefile i've seen. maybe someone could make a suggestion as to where to put my header files so that they are compiled on regular make. any other suggestions are welcome as well. also, i added BCK_FILES to the cleanup option cause i have a directory called backup where i store copies of the src directory temporarily during questionable coding projects. oh and to answer tyche's question of "why another make clean" one is for when i make backups and don't want all the object files and all that crap making it bigger. which i thought was quite obvious by the ECHOCMD Making clean for backing up. the reason i have it doing make at the end of the clean option is to save myself one more step since every time i make clean i make. if i wanted it to just be clean without compiling i'll just use the make cleanup command.
[edit to add]also, lobotomy mentioned colorizing the error messages themselves, i haven't figured out how to do this yet but would gladly colorize that instead of the other stuff if someone could tell me how.
I pooped in his cornflakes this morning.
My bad!