diff --git a/.gitignore b/.gitignore index a6e30ac..1a0b348 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ simpleskycam *~ U2SM200C-AST_Cfg_A.bin U2SM200C-AST_Cfg_SAVE.bin +gmon.out diff --git a/Makefile b/Makefile index bf912d2..42aec55 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ VERSION = 0.0.1 APP = simpleskycam -include Makefile.config +-include Makefile.config -include Makefile.rules OBJECTS := $(OBJECTS) gui.oo main.oo error.oo debug.oo \ @@ -47,15 +47,24 @@ endif - - ifeq ($(TARGET),) -noconfig: configlinux help +noconfig: defaultconfig help endif - all: Makefile.rules $(TARGET) +defaultconfig: +ifeq ($(MAKEFILE_CONFIG),) + echo "MAKEFILE_CONFIG = 1" > Makefile.config + echo "" >> Makefile.config + echo "USE_SVBONY = 1" >> Makefile.config + echo "USE_DNG = 1" >> Makefile.config + echo "USE_SER = 1" >> Makefile.config + echo "" >> Makefile.config + echo "DEBUG_ANGLES = 0" >> Makefile.config + echo "DEBUG_POSCTL = 0" >> Makefile.config +endif + help: echo "set up configuration" echo " make configlinux to generate the linix build" @@ -148,6 +157,9 @@ $(TARGET): $(OBJECTS) .cc.oo : $(INCLUDES) $(CPP) -o $@ -c $(CPPFLAGS) $< +cleanall: clean + rm -rf Makefile.config + clean: rm -f *.o *.oo *.c~ *.h~ *.cc~ *.ui~ $(APP) Makefile~ rm -rf config.h @@ -159,7 +171,7 @@ clean: rm -rf U2SM200C-AST_Cfg_SAVE.bin rm -rf SimpleSkyCam-$(VERSION) -dist: clean +dist: cleanall rm -rf $(DISTNAME) mkdir $(DISTNAME) cp Makefile* $(DISTNAME) diff --git a/Makefile.config b/Makefile.config deleted file mode 100644 index f5defc9..0000000 --- a/Makefile.config +++ /dev/null @@ -1,12 +0,0 @@ - -# -# configurations should be made in here. -# set one of these variables to 0 to disable the function. -# -USE_SVBONY = 1 -USE_DNG = 1 -USE_SER = 1 - -DEBUG_ANGLES = 0 -DEBUG_POSCTL = 0 - diff --git a/videodev-dumpfile.cc b/videodev-dumpfile.cc index 2d33aff..7f0f98a 100644 --- a/videodev-dumpfile.cc +++ b/videodev-dumpfile.cc @@ -121,7 +121,11 @@ int VideoDev_Dumpfile::Open() { } filesize = s.st_size; +#ifdef BUILD_WINDOWS if ((fd = open(fname.c_str(), O_RDONLY | O_BINARY)) == -1) { +#else + if ((fd = open(fname.c_str(), O_RDONLY)) == -1) { +#endif printf ("%s:%d could not open file '%s' error:%s\n", __FILE__, __LINE__, fname.c_str(), strerror(errno)); return VDEV_STATUS_ERROR; }