############################################################################## ## Source-level Makefile for jzintv ## ## The whole make process is driven from the top-level Makefile. In contrast ## to the (poor) advice given in the Make documentation, I do _not_ call make ## recursively to build the source of this project. ############################################################################## ############################################################################## ## Project directory structure ############################################################################## B=../bin L=../lib X=.exe ############################################################################## ## Project-wide build flags ############################################################################## SDL_DIR = C:\joe\mingw SDL_CFLAGS := $(shell sdl-config --cflags) SDL_LFLAGS := $(shell sdl-config --libs) WARN = -Wall -W -Wshadow -Wpointer-arith WARN += -Wbad-function-cast -Wcast-qual WARNXX = -Wall -W -Wshadow -Wpointer-arith -Wcast-qual CC = gcc CXX = g++ DEF_FLAGS = -DWIN32 -DDOSTMP #OPT_FLAGS = -O #OPT_FLAGS = -O -ggdb OPT_FLAGS = -O6 -fomit-frame-pointer #-march=pentium4 #OPT_FLAGS = -O2 -pg -ggdb CFLAGS = $(OPT_FLAGS) $(WARN) -I. -I.. $(DEF_FLAGS) $(EXTRA) CXXFLAGS = $(OPT_FLAGS) $(WARNXX) -I. -I.. $(DEF_FLAGS) $(EXTRA) LFLAGS = -L../lib OBJS=jzintv.o PROG=$(B)/jzintv TOCLEAN=$(B)/jzintv core PROGS=$(PROG) JZ_CFLAGS = $(CFLAGS) $(SDL_CFLAGS) JZ_LFLAGS = $(LFLAGS) $(SDL_LFLAGS) ############################################################################## ## Generic build-rules ############################################################################## all: mk_tbl_hack $(OBJS) $(PROG) mk_tbl_hack: make -f Makefile.w32 $(B)/mk_tbl # copy $(B)/mk_tbl $(B)/mk_tbl.exe $(PROG): $(OBJS) $(CC) -o $(PROG) $(OBJS) $(JZ_CFLAGS) $(JZ_LFLAGS) clean: for %f in ( $(OBJS) $(TOCLEAN) ) do del %f %.o: %.c $(CC) -o $@ $(CFLAGS) -c $< ############################################################################## ## Makefile.common includes all the subMakefiles and such ############################################################################## include Makefile.common