Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22113

How to use a makefile with Gtk

$
0
0

My code is supposed to be divided into client, server, and header files. This is the makefile when it's all in one file -

# change application name here (executable output name)TARGET=BugTrack# compilerCC=gcc# debugDEBUG=-g# optimisationOPT=-O0# warningsWARN=-WallPTHREAD=-pthreadCCFLAGS=$(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipeGTKLIB=`pkg-config --cflags --libs gtk+-3.0`# linkerLD=gccLDFLAGS=$(PTHREAD) $(GTKLIB) -export-dynamicOBJS= client.o all: $(OBJS)    $(LD) -o $(TARGET) $(OBJS) $(LDFLAGS)client.o: client.c    $(CC) -c $(CCFLAGS) client.c  $(GTKLIB) -o client.oclean:    rm -f *.o $(TARGET)

And this works. But changing the last part to this -

OBJS= client.o server.oall: $(OBJS)    $(LD) -o $(TARGET) $(OBJS) $(LDFLAGS)client.o: client.c    $(CC) -c $(CCFLAGS) client.c header.h $(GTKLIB) -o client.oserver.o: server.c    $(CC) -c $(CCFLAGS) server.c header.h $(GTKLIB) -o server.oclean:    rm -f *.o $(TARGET)

Gives me an error that says fatal error: cannot specify -o with -c, -S or -E with multiple files.How do I fix it?


Viewing all articles
Browse latest Browse all 22113

Trending Articles