- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
There is aMakefile works fineunder fedora core 3 with gcc 3.4. Ineed to port it to WindowswithIntel C++ compiler for Windows.ButI know little about Makefile and have no idea how to do it. I googled it hard, but find little information about it.
Could anyone give me some instruction how to do it?
Thanks a lot!
Jerry
[cpp]#************Makefile for libsnd3.a*************
CC = gcc
CPP = g++
LOADLIBES =-lm
INCLUDES = -I.
CFLAGS = -Wall -O3
CPPFLAGS = $(CFLAGS)
PROGRAM =
LIBSND = libsnd3.a
SNDLIBS = ptu.o pwv_data.o tm_data.o wind.o timesub.o sonde_data.o
all: $(PROGRAM) $(LIBSND)
$(LIBSND): $(SNDLIBS)
ar r $@ $?
ptu.o: ptu.h
pwv_data.o: pwv_data.h
sonde.o: sonde.h
sonde_data.o: sonde_data.h
tm_data.o: tm_data.h
wind.o: wind.h
timesub.o: timesub.h
#sonde.h: sonde_data.h pwv_data.h tm_data.h
sonde_data.h: ptu.h wind.h timesub.h
clean:
rm -f *.o
rm -f $(LIBSND)
rm -f *.stackdump
bak:
rm -f *.bak
distclean: clean
rm -f $(PROGRAM)
rm -f *.exe
rm -f *~
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
.cc.o:
$(CPP) $(CPPFLAGS) $(INCLUDES) -c $< [/cpp]
[cpp][/cpp]
[cpp][/cpp]
[cpp][/cpp]
[cpp][/cpp]
[cpp]#*************Makefile for EXE program****************
SNDLIBDIR = ./lib
LIBSND = libsnd3.a
CC=gcc
CPP=g++
LIBS = $(LIBSND)
LOADLIBES = -L$(SNDLIBDIR) -lm -lsnd3
INCLUDES = -I$(SNDLIBDIR) -I.
CFLAGS = -Wall -O3 -g
CPPFLAGS = $(CFLAGS)
PROGRAM = snd_wyoming snd_vaisala_aed snd_vaisala_mw31
all: $(LIBS) $(PROGRAM)
$(LIBSND):
(cd $(SNDLIBDIR); make)
snd_wyoming: snd2pwv.o sonde.o io_wyoming.o
$(CPP) $(CPPFLAGS) -o $@ snd2pwv.o sonde.o io_wyoming.o $(LOADLIBES)
snd_vaisala_aed: snd2pwv.o sonde.o io_vaisala_aed.o
$(CPP) $(CPPFLAGS) -o $@ snd2pwv.o sonde.o io_vaisala_aed.o $(LOADLIBES)
snd_vaisala_mw31: snd2pwv.o sonde.o io_vaisala_mw31.o
$(CPP) $(CPPFLAGS) -o $@ snd2pwv.o sonde.o io_vaisala_mw31.o $(LOADLIBES)
sonde.o: sonde.h
io_wyoming.o: sonde.h
io_visala_aed.o: sonde.h
clean:
rm -f *.o
rm -f *~
rm -f *.stackdump
bak:
rm -f *.bak
libclean:
(cd $(SNDLIBDIR); make distclean)
distclean: clean libclean
rm -f $(PROGRAM)
rm -f *.exe
rm -f *~
#include rules.mk
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
.cc.o:
$(CPP) $(CPPFLAGS) $(INCLUDES) -c $< [/cpp]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
That is right.
You can consider using the "nmake" tool to build your makefile on Windows. See http://support.microsoft.com/kb/60340/en-us and http://support.microsoft.com/kb/132084/en-us
You need to make sure that your library dependencies are resolved.
Take care,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
That is right.
You can consider using the "nmake" tool to build your makefile on Windows. See http://support.microsoft.com/kb/60340/en-us and http://support.microsoft.com/kb/132084/en-us
You need to make sure that your library dependencies are resolved.
Take care,
Ganesh
Thanks for all comments.
I already set the environment variable, while I issued command "icl -I. /c ptu.cc",icl still complained error: identifier "isinf" is undefined.
Is there anything missing?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page