Hello... I am really in desperate situation. I am a dev C++ programmer. I have never done programming in Unix or with cygwin before. Now I have to use C++ header files that have been written for Unix, and I have to include them and develop my own program. I dont know how to handle two platforms. Files written in Unix seem to use posix file names(front slashes) and I cant include them in my program. Since I am a PC-user I will use cygwin environment. I dont know how to work this around. How to create a makefile and handle this project. Can anyone guide me how to deal with this.
Makefiles allow you to use "if-then-else" logic, so all you need to do is set a variable to indicate upon which platform you are compiling, then add code to look at that variable to use one set of defines with the forward slashes for UNIX/Cygwin, or back slashes for Windows:
1 2 3 4 5 6 7 8 9 10 11
# NOTE: I'll leave this up to you to figure out how to determine this:
PLATFORM=UNIX
#ifeq ($(PLATFORM),UNIX)
MYLIB=./mylib.a
else
MYLIB=.\mylib.a
endif