File: fix_objdir

package info (click to toggle)
jhead 1%3A3.08-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,312 kB
  • sloc: ansic: 4,240; sh: 145; makefile: 44; python: 30
file content (27 lines) | stat: -rw-r--r-- 692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Index: jhead/makefile
===================================================================
--- jhead.orig/makefile
+++ jhead/makefile
@@ -26,12 +26,12 @@ all: objdir jhead
 docs = $(SRC)/usage.html
 
 objdir:
-	@mkdir -p obj
+	mkdir -p $(OBJ)
 
 objs = $(OBJ)/jhead.o $(OBJ)/jpgfile.o $(OBJ)/jpgqguess.o $(OBJ)/paths.o \
 	$(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o
 
-$(OBJ)/%.o:$(SRC)/%.c objdir
+$(OBJ)/%.o:$(SRC)/%.c | objdir
 	${CC} $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 
 jhead: $(objs) jhead.h
@@ -39,6 +39,7 @@ jhead: $(objs) jhead.h
 
 clean:
 	rm -f $(objs) jhead
+	if [ -d $(OBJ) ]; then rmdir $(OBJ); fi
 
 install: all
 	install -d $(BINDIR) $(DOCDIR) $(MANDIR)