ipw969 / CMPT332

0 stars 0 forks source link

Makefile Rev. 1 #6

Closed iainworkman closed 8 years ago

iainworkman commented 8 years ago

Makefile that compiles all Part A programs and Part C. For Part A.2 and Part A.3, have commands that compile a dummy pthreads and Posix threads program, respectively. Nothing has to execute for PartA.2 and A.3. For Part C, you must make a library named liblist.a, and supply a test program called mytestlist.c and lines in the makefile to create an executable called mytestlist. For Phase 3, we will use our own test program to verify the functionality of your assignment. Take care to ensure that you do not try and compile Linux code on Windows nor Windows code on Linux. This can be done by if statements in the makefile.

iainworkman commented 8 years ago

From the tutorial:

UNAME_S=$(shell uname -s)

ifeq ($(UNAME_S), "MINGW32_NT-6.1")
  TARGET=partA1.exe
else
  ...
endif

all: $(TARGET)

partA1.exe: partA1.o commonWin.o
        $(CC) $(CFLAGS) -o partA1.exe partA1.o commonWin.o

partA1.o: partA1.c
        $(CC) $(CFLAGS) -c partA1.o partA1.c

clean:
    rm -f *.o $(TARGET)