|
Re: DIY Static Library
Absolutely. I've created two libraries for our team. Although I sure that you can create them from the Workbench environment, I find it is easier from the command line. I've included the Makefile, but if you don't speak Makefile, then ask questions and I'll try to answer them.
Here is the Makefile that I used to create the CANJaguarLib.a:
# source files.
SRC = CANJaguar.cpp
OBJ = $(SRC:.cpp=.o)
OUT = CANJaguarLib.a
# include directories
INCLUDES = -I. -I$(WIND_BASE)/target/h -IC:/Team_116_2010/Jaguar -IC:/windriver/
vxworks-6.3/target/h/WPIlib
# C++ compiler flags (-g -O2 -Wall)
CCFLAGS = -g
# compiler
CCC = ccppc
# library paths
LIBS = -LC:/Team_116_2010/lib -lm
# compile flags
LDFLAGS = -g
.SUFFIXES: .cpp
default: dep $(OUT)
.cpp.o:
$(CCC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(OUT): $(OBJ)
arppc rcs $(OUT) $(OBJ)
depend: dep
dep:
clean:
rm -f $(OBJ) $(OUT) Makefile.bak
|