Files
dealornodeal/makefile

82 lines
2.3 KiB
Makefile
Executable File

# makefile -- gnu make
# MAN 28 Dec 06
# idea is to build from the PC directory structure into D1
H1=.
D1=./linux/tmp
S1=./dond/core
OBJ1=$(D1)/cab.o $(D1)/cam.o $(D1)/fc.o $(D1)/fs.o $(D1)/ftp.o $(D1)/gun.o \
$(D1)/inp.o $(D1)/mem.o $(D1)/mem_data.o $(D1)/obj.o $(D1)/proc.o \
$(D1)/res.o $(D1)/snd.o $(D1)/str.o $(D1)/sys.o \
$(D1)/theorafunc.o $(D1)/vec.o
S2=./dond/corebb
OBJ2=$(D1)/int_bb.o $(D1)/main_bb.o $(D1)/sys_bb.o $(D1)/wnd_bb.o
S3=./dond/coregl
OBJ3=$(D1)/diag_gl.o $(D1)/draw_gl.o $(D1)/fb_gl.o $(D1)/font_gl.o $(D1)/fs_gl.o \
$(D1)/net_gl.o $(D1)/obj_gl.o $(D1)/res_gl.o $(D1)/vid_gl.o
S4=./dond/game
OBJ4=$(D1)/at.o $(D1)/aud.o $(D1)/credits.o \
$(D1)/currency.o $(D1)/diag.o $(D1)/dond.o \
$(D1)/fcfunc.o $(D1)/game.o $(D1)/gcon.o $(D1)/m.o \
$(D1)/text3d.o $(D1)/dummylpt.o $(D1)/donglecheck.o
# OBJ4B is a list of game files that should not be added to the game library
# as they are intended to be built by outside groups
OBJ4B=$(D1)/prts_interface.o $(D1)/prts_msg.o $(D1)/prts_utils.o
buildall=$(D1)/game
CFLAGS=-g -DSYS_BB -DSYS_GL -DDEBUG
#CFLAGS=-DSYS_BB -DSYS_GL -DDEBUG
#CFLAGS=-DSYS_BB -DSYS_GL -DPRODUCTION
CFLAGS+=-O1
CFLAGS+=-Wno-sign-compare -Wno-conversion -Wno-missing-prototypes
CFLAGS+=-I $(H1)/dond/core -I $(H1)/dond/game -I $(H1)/dond/game/ogginclude -I $(H1)/lib
CFLAGS+=-I /usr/X11/include -I /usr/local/include
CFLAGS+=-I /g3/include
CC=gcc
LD=gcc --mode=link
LFLAGS=-L/usr/X11/lib -lGL -lGLU -lglut -lpthread -lrt
LIBS=$(H1)/lib/librockeyapi.a $(H1)/lib/libjps.a $(H1)/lib/libjamma.a \
$(H1)/ogglibs/libtheora.so.0.1.0 $(H1)/ogglibs/libogg.so.0.5.2
LIBS+=$(H1)/lib/libusb.a $(H1)/lib/libpmrt_utils.a
# library name for game
TARGETLIB = $(D1)/libgame.a
$(D1)/game: $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ4B) $(LIBS)
$(LD) $(LFLAGS) $^ -o $@
cp $(D1)/game .
$(D1)/%.o : $(S1)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(D1)/%.o : $(S2)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(D1)/%.o : $(S3)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(D1)/%.o : $(S4)/%.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean
all: $(buildall)
clean:
rm $(D1)/*.o
# lib target makes the game objects an archive
lib: $(TARGETLIB)
$(TARGETLIB) : $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
ar rs $(TARGETLIB) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4)
cp $(TARGETLIB) ./lib