Bladeren bron

several makefile corrections

Douglas A 4 jaren geleden
bovenliggende
commit
df618788c2
5 gewijzigde bestanden met toevoegingen van 5 en 53 verwijderingen
  1. 2 2
      libpng/Makefile
  2. BIN
      mandelbrot/mandel.png
  3. 1 12
      pthread/Makefile
  4. 0 30
      pthread/example.c
  5. 2 9
      x11-random/Makefile

+ 2 - 2
libpng/Makefile

@@ -6,8 +6,8 @@ OBJS=$(OBJ)/img.o
 
 
 all: $(OBJS)
-	$(CC) $(CFLAGS) $(OBJS) png.c -o bin/png
+	$(CC) $(CFLAGS) $(OBJS) png.c -o bin/png -lpng
 
 $(OBJ)/img.o:
-	$(CC) $(CFLAGS)	-c img.c -o $(OBJ)/img.o
+	$(CC) $(CFLAGS)	-c img.c -o $(OBJ)/img.o -lpng
 

BIN
mandelbrot/mandel.png


+ 1 - 12
pthread/Makefile

@@ -1,5 +1,5 @@
 CC=/usr/bin/gcc
-<<<<<<< HEAD
+
 CFLAGS=-Wall -Werror -fno-builtin -O0 -g -pthread -m64 -std=iso9899:1999
 OBJ=bin/obj
 OBJS=$(OBJ)/example.o $(OBJ)/example2.o $(OBJ)/foo.o
@@ -17,14 +17,3 @@ bin/obj/example.o: example.c
 
 bin/obj/example2.o: example2.c
 	$(CC) $(CFLAGS) -c -o $(OBJ)/example2.o example2.c
-=======
-CFLAGS=-Wall -Werror -fno-builtin -O0 -g -pthread -m64 -std=iso9899:1990
-OBJ=bin/obj
-OBJS=$(OBJ)/example.o
-
-all: $(OBJS)
-	$(CC) $(CFLAGS) -o bin/example $(OBJS)
-
-bin/obj/example.o:
-	$(CC) $(CFLAGS) -c -o bin/obj/example.o example.c
->>>>>>> 78289eb... all: several makefile corrections and organization steps

+ 0 - 30
pthread/example.c

@@ -25,33 +25,3 @@ void *runner1(void *arg)
     pthread_exit(0);
 }
 
-int main(int argc, char **argv)
-{
-
-    int i;
-    pthread_t id[argc];
-    pthread_attr_t attr;
-    struct fibo d[argc];
-
-    if (argc < 2) {
-	printf("usage: %s num1 num2 num3... numN", argv[0]);
-	return (1);
-    }
-
-
-
-    pthread_attr_init(&attr);
-    for (i = 1; i < argc; i++) {
-	d[i - 1].limit = atoi(argv[i]);
-	d[i - 1].answer = 0;
-	pthread_create(&id[i - 1], &attr, runner1, &d[i - 1]);
-    }
-
-    for (i = 0; i < argc - 1; i++) {
-	pthread_join(id[i], NULL);
-	printf("\n\nFib of limit: %d is %d", d[i].limit, d[i].answer);
-    }
-
-    return (0);
-
-}

+ 2 - 9
x11-random/Makefile

@@ -5,20 +5,13 @@ OBJ=$(OUT)/obj
 OBJS=$(OBJ)/worley_noise.o
 
 
-<<<<<<< HEAD
 all: bin/worley_noise
 
 bin/worley_noise: $(OBJS)
-	$(CC) $(CFLAGS) $(OBJS) -o $(OUT)/worley_noise
+	$(CC) $(CFLAGS) $(OBJS) -o $(OUT)/worley_noise -lX11 -lm
 
 bin/obj/worley_noise.o: worley_noise.c
-=======
-all: $(OBJS)
-	$(CC) $(CFLAGS) $(OBJS) -o $(OUT)/worley_noise
-
-bin/obj/worley_noise.o:
->>>>>>> 78289eb... all: several makefile corrections and organization steps
-	$(CC) $(CFLAGS) -c worley_noise.c -o $(OBJ)/worley_noise.o
+	$(CC) $(CFLAGS) -c worley_noise.c -o $(OBJ)/worley_noise.o -lX11 -lm
 
 clean:
 	find ./bin -type f -exec rm {} \;