Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked Makefiles to allow for parallel builds via make -j #76

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@

# Libraries
LIBS = src
SUBDIRS = src

all:
for subdir in $(LIBS); do \
echo making $@ in $$subdir; \
(cd $$subdir && $(MAKE)) || exit 1; \
done
all: $(SUBDIRS)

clean:
for subdir in $(LIBS); do \
echo $@ in $$subdir; \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done
clean: $(SUBDIRS)

$(SUBDIRS)::
$(MAKE) -C $@ $(MAKECMDGOALS)

43 changes: 19 additions & 24 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,38 @@ include makedefs
# simulation : -
# terrain : -
#
PROJECTS = basic
PROJECTS += basicGL instruments
PROJECTS += dafif
PROJECTS += ioDevice
PROJECTS += linearSys
PROJECTS += simulation sensors terrain
PROJECTS += dis
PROJECTS += dynamics
PROJECTS += maps
PROJECTS += recorder
SUBDIRS = basic
SUBDIRS += basicGL
SUBDIRS += instruments
SUBDIRS += dafif
SUBDIRS += ioDevice
SUBDIRS += linearSys
SUBDIRS += simulation sensors terrain
SUBDIRS += dis
SUBDIRS += dynamics
SUBDIRS += maps
SUBDIRS += recorder

#
# GUI interface libraries
#
PROJECTS += "gui/glut"
SUBDIRS += "gui/glut"

# Out-the-Window interface classes to talk to visual systems
# - CIGI Class Library 3.x interface
# - download and install cigicl
PROJECTS += otw
SUBDIRS += otw

#
# HLA interface library
#
#PROJECTS += "hla"
#SUBDIRS += "hla"

#
# Rules
#
all:
@echo ${OE_ROOT}
for subdir in $(PROJECTS); do \
echo making $@ in $$subdir; \
(cd $$subdir && $(MAKE)) || exit 1; \
done

all: $(SUBDIRS)

install: uninstall
-cp -r ../include/openeaagles /usr/local/include/openeaagles
Expand All @@ -64,10 +61,8 @@ uninstall:
-rm -rf /usr/local/include/openeaagles
-rm -rf /usr/local/lib/openeaagles

clean:
clean: $(SUBDIRS)
-rm -f *.o
for subdir in $(PROJECTS); do \
echo $@ in $$subdir; \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done

$(SUBDIRS)::
$(MAKE) -C $@ $(MAKECMDGOALS)
141 changes: 66 additions & 75 deletions src/basic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,79 @@ include ../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(support.o) \
$(LIB)(basicFF.o) \
$(LIB)(Boolean.o) \
$(LIB)(Cie.o) \
$(LIB)(Cmy.o) \
$(LIB)(Color.o) \
$(LIB)(Complex.o) \
$(LIB)(Component.o) \
$(LIB)(Decibel.o) \
$(LIB)(EarthModel.o) \
$(LIB)(Factory.o) \
$(LIB)(FileReader.o) \
$(LIB)(Float.o) \
$(LIB)(Function.o) \
$(LIB)(Functions.o) \
$(LIB)(Hls.o) \
$(LIB)(Hsva.o) \
$(LIB)(Hsv.o) \
$(LIB)(Identifier.o) \
$(LIB)(Integer.o) \
$(LIB)(IoAdapter.o) \
$(LIB)(IoData.o) \
$(LIB)(IoDevice.o) \
$(LIB)(IoHandler.o) \
$(LIB)(LatLon.o) \
$(LIB)(Lexical.o) \
$(LIB)(List.o) \
$(LIB)(Locus.o) \
$(LIB)(Logger.o) \
$(LIB)(Matrix.o) \
$(LIB)(Nav.o) \
$(LIB)(NavDR.o) \
$(LIB)(NetHandler.o) \
$(LIB)(Number.o) \
$(LIB)(Object.o) \
$(LIB)(Operators.o) \
$(LIB)(Pair.o) \
$(LIB)(PairStream.o) \
$(LIB)(Parser.o) \
$(LIB)(Rgba.o) \
$(LIB)(Rgb.o) \
$(LIB)(Rng.o) \
$(LIB)(SlotTable.o) \
$(LIB)(Stack.o) \
$(LIB)(Statistic.o) \
$(LIB)(StateMachine.o) \
$(LIB)(String.o) \
$(LIB)(Table.o) \
$(LIB)(Tables.o) \
$(LIB)(Terrain.o) \
$(LIB)(Thread.o) \
$(LIB)(ThreadPool.o) \
$(LIB)(Timers.o) \
$(LIB)(Transforms.o) \
$(LIB)(Vectors.o) \
$(LIB)(Yiq.o)
support.o \
basicFF.o \
Boolean.o \
Cie.o \
Cmy.o \
Color.o \
Complex.o \
Component.o \
Decibel.o \
EarthModel.o \
Factory.o \
FileReader.o \
Float.o \
Hls.o \
Hsva.o \
Hsv.o \
Identifier.o \
Integer.o \
IoAdapter.o \
IoData.o \
IoDevice.o \
IoHandler.o \
LatLon.o \
Lexical.o \
List.o \
Locus.o \
Logger.o \
Matrix.o \
Nav.o \
NavDR.o \
NetHandler.o \
Number.o \
Object.o \
Operators.o \
Pair.o \
PairStream.o \
Parser.o \
Rgba.o \
Rgb.o \
Rng.o \
SlotTable.o \
Stack.o \
Statistic.o \
StateMachine.o \
String.o \
Terrain.o \
Thread.o \
ThreadPool.o \
Timers.o \
Transforms.o \
Vectors.o \
Yiq.o

SUBDIRS = distributions functors nethandlers osg ubf units util

all: subdirs ${OBJS}

subdirs:
all:
$(MAKE) compile
$(MAKE) archive

compile: $(SUBDIRS) ${OBJS}

archive:
for subdir in $(SUBDIRS); do \
echo making $@ in $$subdir; \
(cd $$subdir && $(MAKE)) || exit 1; \
$(MAKE) -C $$subdir $(MAKECMDGOALS); \
done
ar rv $(LIB) ${OBJS}

$(LIB)(Lexical.o): Lexical.cpp Parser.cpp Parser.hpp

#Parser.cpp: Parser.y
# dos2unix Parser.y
# bison -t Parser.y -o Parser.cpp

#Lexical.cpp: Lexical.l
# dos2unix Lexical.l
# flex -f -oLexical.cpp Lexical.l
Lexical.o: Lexical.cpp Parser.cpp Parser.hpp

clean:
clean: $(SUBDIRS)
-rm -f *.o
for subdir in $(SUBDIRS); do \
echo making $@ in $$subdir; \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done
-rm -f $(LIB)

$(SUBDIRS)::
$(MAKE) -C $@ $(MAKECMDGOALS)

17 changes: 12 additions & 5 deletions src/basic/distributions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ include ../../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(Exponential.o) \
$(LIB)(Lognormal.o) \
$(LIB)(Pareto.o) \
$(LIB)(Uniform.o)
Exponential.o \
Lognormal.o \
Pareto.o \
Uniform.o

all: ${OBJS}
all:
$(MAKE) compile
$(MAKE) archive

compile: ${OBJS}

archive:
ar rv $(LIB) ${OBJS}

clean:
-rm -f *.o
Expand Down
17 changes: 12 additions & 5 deletions src/basic/functors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ include ../../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(Function.o) \
$(LIB)(Functions.o) \
$(LIB)(Table.o) \
$(LIB)(Tables.o)
Function.o \
Functions.o \
Table.o \
Tables.o

all: ${OBJS}
all:
$(MAKE) compile
$(MAKE) archive

compile: ${OBJS}

archive:
ar rv $(LIB) ${OBJS}

clean:
-rm -f *.o
Expand Down
25 changes: 16 additions & 9 deletions src/basic/nethandlers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ include ../../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(PosixHandler.o) \
$(LIB)(TcpClient.o) \
$(LIB)(TcpHandler.o) \
$(LIB)(TcpServerMultiple.o) \
$(LIB)(TcpServerSingle.o) \
$(LIB)(UdpBroadcastHandler.o) \
$(LIB)(UdpMulticastHandler.o) \
$(LIB)(UdpUnicastHandler.o)
PosixHandler.o \
TcpClient.o \
TcpHandler.o \
TcpServerMultiple.o \
TcpServerSingle.o \
UdpBroadcastHandler.o \
UdpMulticastHandler.o \
UdpUnicastHandler.o

all: ${OBJS}
all:
$(MAKE) compile
$(MAKE) archive

compile: ${OBJS}

archive:
ar rv $(LIB) ${OBJS}

clean:
-rm -f *.o
Expand Down
19 changes: 13 additions & 6 deletions src/basic/osg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ include ../../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(Math.o) \
$(LIB)(Matrixd.o) \
$(LIB)(MatrixDecomposition.o) \
$(LIB)(Matrixf.o) \
$(LIB)(Quat.o)
Math.o \
Matrixd.o \
MatrixDecomposition.o \
Matrixf.o \
Quat.o

all: ${OBJS}
all:
$(MAKE) compile
$(MAKE) archive

compile: ${OBJS}

archive:
ar rv $(LIB) ${OBJS}

clean:
-rm -f *.o
19 changes: 13 additions & 6 deletions src/basic/ubf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ include ../../makedefs
LIB = $(OPENEAAGLES_LIB_DIR)/liboeBasic.a

OBJS = \
$(LIB)(Action.o) \
$(LIB)(Agent.o) \
$(LIB)(Arbiter.o) \
$(LIB)(Behavior.o) \
$(LIB)(State.o)
Action.o \
Agent.o \
Arbiter.o \
Behavior.o \
State.o

all: ${OBJS}
all:
$(MAKE) compile
$(MAKE) archive

compile: ${OBJS}

archive:
ar rv $(LIB) ${OBJS}

clean:
-rm -f *.o
Expand Down
Loading