Simplify build: nested makefiles considered harmful.
This commit is contained in:
parent
7e82c2f910
commit
5ae76995d2
10 changed files with 18 additions and 32 deletions
21
Makefile
21
Makefile
|
@ -1,31 +1,34 @@
|
||||||
# Makefile for the open-source release of adventure 2.5
|
# Makefile for the open-source release of adventure 2.5
|
||||||
|
|
||||||
LIBS=-lrt
|
LIBS=-lrt
|
||||||
OBJS=main.o init.o actions1.o actions2.o score.o misc.o database/database.o
|
OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o
|
||||||
SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control
|
SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
gcc -O $(DBX) -c $<
|
gcc -O $(DBX) -c $<
|
||||||
|
|
||||||
advent: $(OBJS) database
|
advent: $(OBJS)
|
||||||
gcc -Wall -std=c99 -O $(DBX) -o advent $(OBJS) $(LIBS)
|
gcc -Wall -std=c99 -O $(DBX) -o advent $(OBJS) $(LIBS)
|
||||||
|
|
||||||
main.o: main.h misc.h funcs.h database/database.h
|
main.o: main.h misc.h funcs.h database.h
|
||||||
|
|
||||||
init.o: misc.h main.h share.h funcs.h database/database.h
|
init.o: misc.h main.h share.h funcs.h database.h
|
||||||
|
|
||||||
actions1.o: misc.h main.h share.h funcs.h database/database.h
|
actions1.o: misc.h main.h share.h funcs.h database.h
|
||||||
|
|
||||||
actions2.o: misc.h main.h share.h funcs.h
|
actions2.o: misc.h main.h share.h funcs.h
|
||||||
|
|
||||||
score.o: misc.h main.h share.h database/database.h
|
score.o: misc.h main.h share.h database.h
|
||||||
|
|
||||||
misc.o: misc.h main.h database/database.h
|
misc.o: misc.h main.h database.h
|
||||||
|
|
||||||
|
database.c database.h: compile
|
||||||
|
./compile
|
||||||
|
gcc $(OPTIONS) -O $(DBX) -c database.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o advent advent.html advent.6 adventure.data
|
rm -f *.o advent advent.html advent.6 database.[ch]
|
||||||
cd tests; $(MAKE) --quiet clean
|
cd tests; $(MAKE) --quiet clean
|
||||||
cd database; $(MAKE) clean
|
|
||||||
|
|
||||||
check: advent
|
check: advent
|
||||||
cd tests; $(MAKE) --quiet
|
cd tests; $(MAKE) --quiet
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "share.h"
|
#include "share.h"
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
|
|
||||||
/* This stuff was broken off as part of an effort to get the main program
|
/* This stuff was broken off as part of an effort to get the main program
|
||||||
* to compile without running out of memory. We're called with a number
|
* to compile without running out of memory. We're called with a number
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Makefile for the open-adventure database
|
|
||||||
|
|
||||||
OBJS=compile.o
|
|
||||||
SOURCES=$(OBJS:.o=.c) adventure.text
|
|
||||||
OPTIONS=-ggdb -Wall -std=c99
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
gcc $(OPTIONS) -O $(DBX) -c $<
|
|
||||||
|
|
||||||
database: compile
|
|
||||||
./compile
|
|
||||||
gcc $(OPTIONS) -O $(DBX) -c database.c
|
|
||||||
|
|
||||||
compile: $(OBJS)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(OBJS) compile database.c database.h
|
|
2
funcs.h
2
funcs.h
|
@ -1,5 +1,5 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
|
|
||||||
/* Statement functions
|
/* Statement functions
|
||||||
*
|
*
|
||||||
|
|
2
init.c
2
init.c
|
@ -7,7 +7,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "share.h"
|
#include "share.h"
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialisation
|
* Initialisation
|
||||||
|
|
2
main.c
2
main.c
|
@ -9,7 +9,7 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
long ABB[186], ATLOC[186], BLKLIN = true, DFLAG,
|
long ABB[186], ATLOC[186], BLKLIN = true, DFLAG,
|
||||||
|
|
2
misc.c
2
misc.c
|
@ -6,7 +6,7 @@
|
||||||
#include "share.h" /* for SETUP */
|
#include "share.h" /* for SETUP */
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
|
|
||||||
/* hack to ignore GCC Unused Result */
|
/* hack to ignore GCC Unused Result */
|
||||||
#define IGNORE(r) do{if(r){}}while(0)
|
#define IGNORE(r) do{if(r){}}while(0)
|
||||||
|
|
2
score.c
2
score.c
|
@ -2,7 +2,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "share.h"
|
#include "share.h"
|
||||||
#include "database/database.h"
|
#include "database.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* scoring and wrap-up
|
* scoring and wrap-up
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue