Commit b429f105 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

makefile

parent 9d42b397
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -57,17 +57,18 @@ LIB_DESTDIR = lib
####### 4) Compiler, tools and options
####### 4) Compiler, tools and options


CXX ?= g++
CXX ?= g++
CC ?= gcc
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
CFLAGS ?= -O2 -fPIC
CFLAGS ?= -O3 -fPIC
CXXFLAGS ?= -O3 -fPIC
#Set INCPATH to add the inclusion paths
#Set INCPATH to add the inclusion paths
INCPATH = -I ./include
INCPATH = -I ./include
#Insert the implicit parameter to the compiler:
#Insert the implicit parameter to the compiler:
ALL_CFLAGS = -fexceptions -Wall $(INCPATH) $(CFLAGS)
ALL_CFLAGS = -fexceptions -Wall $(INCPATH)
ifeq ($(SYSTEM), QNX)
ifeq ($(SYSTEM), QNX)
	ALL_CFLAGS += -Vgcc_ntox86_gpp -lang-c++
	ALL_CFLAGS += -Vgcc_ntox86_gpp -lang-c++
endif
endif
#Use CPPFLAGS for the preprocessor

CPPFLAGS ?=
#Set LIBS for addition library
#Set LIBS for addition library
LIBS = -lstdc++ 
LIBS = -lstdc++ 
ifeq ($(SYSTEM), QNX)
ifeq ($(SYSTEM), QNX)
@@ -75,7 +76,7 @@ ifeq ($(SYSTEM), QNX)
endif
endif
ifneq (, $(findstring apple, $(SYSTEM)))
ifneq (, $(findstring apple, $(SYSTEM)))
 	# Do apple things
 	# Do apple things
	CPPFLAGS += -I$(LOCAL)/include
	ALL_CFLAGS += -I$(LOCAL)/include
	LIBS += -L$(LOCAL)/lib
	LIBS += -L$(LOCAL)/lib
endif 
endif 


@@ -128,13 +129,13 @@ $(shell cut $(INCLUDE_DIR)/$(VER_FILE_NAME) -f 3 > version)
####### 9) Pattern rules
####### 9) Pattern rules


test/%.o : test/%.cpp
test/%.o : test/%.cpp
	$(CXX) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@ -I /usr/include/cppunit
	$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -c $< -o $@ -I /usr/include/cppunit


%.o : %.cpp | makeobjdir
%.o : %.cpp | makeobjdir
	$(CXX) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@
	$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@


%.o : %.c | makeobjdir
%.o : %.c | makeobjdir
	$(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@
	$(CC) $(CFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@


#only for documentation generation
#only for documentation generation
$(DOXY_SOURCE_DIR)/%.h : %.h
$(DOXY_SOURCE_DIR)/%.h : %.h
@@ -152,14 +153,14 @@ lib: staticlib
	
	
exe: main.o $(OBJECTS)
exe: main.o $(OBJECTS)
		test -d $(EXE_DESTDIR) || mkdir -p $(EXE_DESTDIR)
		test -d $(EXE_DESTDIR) || mkdir -p $(EXE_DESTDIR)
		$(CXX) $(CPPFLAGS) $(ALL_CFLAGS) -o $(EXE_DESTDIR)/$(EXE_NAME) $(OBJECTS_DIR)/*.o $(LIBS)
		$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -o $(EXE_DESTDIR)/$(EXE_NAME) $(OBJECTS_DIR)/*.o $(LIBS)
	
	
tests: test/runtests
tests: test/runtests


TESTOBJS = test/InputPacketStreamFileTest.o test/runtests.o
TESTOBJS = test/InputPacketStreamFileTest.o test/runtests.o


test/runtests: $(TESTOBJS) lib
test/runtests: $(TESTOBJS) lib
	$(CXX) $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $(TESTOBJS) -Llib -lpacket $(LIBS) -lcppunit
	$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -o $@ $(TESTOBJS) -Llib -lpacket $(LIBS) -lcppunit


staticlib: $(OBJECTS)
staticlib: $(OBJECTS)
		test -d $(LIB_DESTDIR) || mkdir -p $(LIB_DESTDIR)	
		test -d $(LIB_DESTDIR) || mkdir -p $(LIB_DESTDIR)	
+5 −5
Original line number Original line Diff line number Diff line
@@ -10,29 +10,29 @@
	<string>PacketLib</string>
	<string>PacketLib</string>
	<key>IDESourceControlProjectOriginsDictionary</key>
	<key>IDESourceControlProjectOriginsDictionary</key>
	<dict>
	<dict>
		<key>9D31E5C7-D3D6-4986-9D5E-784921CDF7E3</key>
		<key>87AE3A47C426A969B4ECB716011DCD84ED0D145E</key>
		<string>ssh://github.com/ASTRO-BO/PacketLib.git</string>
		<string>ssh://github.com/ASTRO-BO/PacketLib.git</string>
	</dict>
	</dict>
	<key>IDESourceControlProjectPath</key>
	<key>IDESourceControlProjectPath</key>
	<string>PacketLib.xcodeproj/project.xcworkspace</string>
	<string>PacketLib.xcodeproj/project.xcworkspace</string>
	<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
	<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
	<dict>
	<dict>
		<key>9D31E5C7-D3D6-4986-9D5E-784921CDF7E3</key>
		<key>87AE3A47C426A969B4ECB716011DCD84ED0D145E</key>
		<string>../..</string>
		<string>../..</string>
	</dict>
	</dict>
	<key>IDESourceControlProjectURL</key>
	<key>IDESourceControlProjectURL</key>
	<string>ssh://github.com/ASTRO-BO/PacketLib.git</string>
	<string>ssh://github.com/ASTRO-BO/PacketLib.git</string>
	<key>IDESourceControlProjectVersion</key>
	<key>IDESourceControlProjectVersion</key>
	<integer>110</integer>
	<integer>111</integer>
	<key>IDESourceControlProjectWCCIdentifier</key>
	<key>IDESourceControlProjectWCCIdentifier</key>
	<string>9D31E5C7-D3D6-4986-9D5E-784921CDF7E3</string>
	<string>87AE3A47C426A969B4ECB716011DCD84ED0D145E</string>
	<key>IDESourceControlProjectWCConfigurations</key>
	<key>IDESourceControlProjectWCConfigurations</key>
	<array>
	<array>
		<dict>
		<dict>
			<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
			<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
			<string>public.vcs.git</string>
			<string>public.vcs.git</string>
			<key>IDESourceControlWCCIdentifierKey</key>
			<key>IDESourceControlWCCIdentifierKey</key>
			<string>9D31E5C7-D3D6-4986-9D5E-784921CDF7E3</string>
			<string>87AE3A47C426A969B4ECB716011DCD84ED0D145E</string>
			<key>IDESourceControlWCCName</key>
			<key>IDESourceControlWCCName</key>
			<string>PacketLib</string>
			<string>PacketLib</string>
		</dict>
		</dict>
+3.29 KiB (44.8 KiB)

File changed.

No diff preview for this file type.