2013-10-02 19:36:18 +00:00
|
|
|
# CREDDIT MAKEFILE
|
|
|
|
#
|
|
|
|
# To compile the creddit executable either use 'make', or 'make creddit'
|
|
|
|
# To compile libreddit as a static library only, use 'make libreddit'
|
|
|
|
#
|
|
|
|
# You can also compile individual parts or individual files on their own, by
|
|
|
|
# specifying their object name.
|
|
|
|
# Ex. 'make build/src/main.o'
|
|
|
|
|
2013-10-05 20:30:10 +00:00
|
|
|
QUIETLY:=@
|
2013-08-14 13:27:00 +00:00
|
|
|
|
2013-09-02 19:28:06 +00:00
|
|
|
# Set some basic program-wide compile settings
|
|
|
|
# In the future these shouldn't be assumed.
|
2013-10-05 21:01:15 +00:00
|
|
|
CC:=$(QUIETLY)gcc
|
2013-09-02 19:28:06 +00:00
|
|
|
PROJCFLAGS:=-O2 -Wall -I'./include'
|
2013-10-05 21:01:15 +00:00
|
|
|
LD:=$(QUIETLY)ld
|
|
|
|
AR:=$(QUIETLY)ar
|
|
|
|
INSTALL:=$(QUIETLY)install
|
|
|
|
OBJCOPY:=$(QUIETLY)objcopy
|
2013-09-02 19:28:06 +00:00
|
|
|
BUILD_DIR:=build
|
|
|
|
|
2013-10-05 21:01:15 +00:00
|
|
|
MKDIR:=$(QUIETLY)mkdir -p
|
|
|
|
ECHO:=$(QUIETLY)echo
|
|
|
|
RM:=$(QUIETLY)rm
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
ifndef PREFIX
|
|
|
|
PREFIX=/usr
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: real-all
|
|
|
|
|
|
|
|
# Set initial values for 'targets'
|
|
|
|
CLEAN_TARGETS:=
|
|
|
|
COMPILE_TARGETS:=
|
2013-10-02 19:36:18 +00:00
|
|
|
INSTALL_TARGETS:=
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
# Include mk files from any subdirectories
|
|
|
|
# These files add onto the 'targets'
|
|
|
|
include ./libreddit/libreddit.mk
|
2013-10-02 19:36:18 +00:00
|
|
|
include ./src/creddit.mk
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
# Add a few ending values for the main program
|
|
|
|
CLEAN_TARGETS +=build_clean
|
|
|
|
|
2013-10-02 19:36:18 +00:00
|
|
|
.PHONY: all real-all install clean $(CLEAN_TARGETS) $(INSTALL_TARGETS)
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
real-all: $(EXECUTABLE_FULL)
|
|
|
|
|
2013-10-02 19:36:18 +00:00
|
|
|
install: $(INSTALL_TARGETS)
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
$(BUILD_DIR):
|
2013-10-05 21:01:15 +00:00
|
|
|
$(ECHO) " MKDIR $(BUILD_DIR)"
|
|
|
|
$(MKDIR) $(BUILD_DIR)
|
2013-09-02 19:28:06 +00:00
|
|
|
|
|
|
|
# Calls all the clean targets to be run, so we can clean up the build directory
|
|
|
|
clean: $(CLEAN_TARGETS)
|
|
|
|
|
|
|
|
# Top level clean -- deletes whole build directory
|
|
|
|
build_clean:
|
2013-10-05 21:01:15 +00:00
|
|
|
$(ECHO) " RM $(BUILD_DIR)"
|
|
|
|
$(RM) -fr $(BUILD_DIR)
|
2013-08-14 13:27:00 +00:00
|
|
|
|